1 """The Yardian integration."""
3 from __future__
import annotations
5 from pyyardian
import AsyncYardianClient
12 from .const
import DOMAIN
13 from .coordinator
import YardianUpdateCoordinator
15 PLATFORMS: list[Platform] = [Platform.SWITCH]
19 """Set up Yardian from a config entry."""
21 host = entry.data[CONF_HOST]
22 access_token = entry.data[CONF_ACCESS_TOKEN]
26 await coordinator.async_config_entry_first_refresh()
28 hass.data.setdefault(DOMAIN, {})[entry.entry_id] = coordinator
30 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
36 """Unload a config entry."""
38 if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
39 hass.data.get(DOMAIN, {}).pop(entry.entry_id,
None)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, ConfigEntry entry)
aiohttp.ClientSession async_get_clientsession(HomeAssistant hass, bool verify_ssl=True, socket.AddressFamily family=socket.AF_UNSPEC, ssl_util.SSLCipherList ssl_cipher=ssl_util.SSLCipherList.PYTHON_DEFAULT)