refactor: rename JackeryHome component directory and update references

- Renamed the `custom_components/JackeryHome/` directory to `custom_components/jackery_home/` for consistency.
- Updated all references in documentation and scripts to reflect the new directory name.
- Removed obsolete files related to the previous directory structure.
This commit is contained in:
不求圣剑
2025-11-18 15:37:19 +08:00
parent 176f457328
commit 2d22a25006
11 changed files with 96 additions and 72 deletions

View File

@@ -1,39 +0,0 @@
"""Energy Monitor MQTT Integration for Home Assistant."""
import logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.const import Platform
_LOGGER = logging.getLogger(__name__)
DOMAIN = "jackery_home"
PLATFORMS = [Platform.SENSOR]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up JackeryHome from a config entry."""
_LOGGER.info("Setting up JackeryHome integration")
# 存储配置数据
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = entry.data
# 加载传感器平台
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
_LOGGER.info("Unloading JackeryHome integration")
# 卸载传感器平台
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok