This commit is contained in:
yangchengdong
2024-07-19 13:08:46 +08:00
commit 723e41d952
16 changed files with 1516 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.const import Platform
from .const import DOMAIN
from .utils.store import async_load_from_store
from .data_client import StateGridDataClient
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Set up this integration using UI."""
config = await async_load_from_store(hass, "state_grid.config") or None
hass.data[DOMAIN] = StateGridDataClient(hass = hass, config = config)
await hass.config_entries.async_forward_entry_setups(config_entry, [Platform.SENSOR])
return True