22
33from __future__ import annotations
44
5+ import logging
6+
57from homeassistant .exceptions import ConfigEntryError
68from homeassistant .config_entries import ConfigEntry
79from homeassistant .const import Platform , CONF_USERNAME , CONF_PASSWORD
2628
2729CONFIG_SCHEMA = cv .config_entry_only_config_schema (DOMAIN )
2830
31+ _LOGGER = logging .getLogger (__name__ )
32+
2933
3034async def async_setup (hass : HomeAssistant , config : ConfigType ) -> bool :
3135 """Set up ConnectLife."""
@@ -37,6 +41,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
3741
3842async def async_setup_entry (hass : HomeAssistant , entry : ConfigEntry ) -> bool :
3943 """Set up ConnectLife from a config entry."""
44+ _LOGGER .debug ("Setting up ConnectLife" )
45+ _LOGGER .debug ("Options: %s" , entry .options )
4046 hass .data .setdefault (DOMAIN , {})
4147 test_server_url = (
4248 entry .options .get (CONF_TEST_SERVER_URL )
@@ -60,13 +66,15 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
6066
6167 return True
6268
63- async def update_listener (hass , entry ) :
69+ async def update_listener (hass : HomeAssistant , entry : ConfigEntry ) -> bool :
6470 """Handle options update."""
71+ _LOGGER .debug (f"Reloading ConnectLife" )
6572 await hass .config_entries .async_reload (entry .entry_id )
6673
6774
6875async def async_unload_entry (hass : HomeAssistant , entry : ConfigEntry ) -> bool :
6976 """Unload a config entry."""
77+ _LOGGER .debug (f"Unloading ConnectLife" )
7078
7179 if unload_ok := await hass .config_entries .async_unload_platforms (entry , PLATFORMS ):
7280 hass .data [DOMAIN ].pop (entry .entry_id )
0 commit comments