1313from .const import (
1414 CONF_METER_ID , CONF_METER_NAME , CONF_SHOW_12_MONTHS , CONF_SHOW_BALANCED , CONF_SHOW_BALANCED_YEAR ,
1515 CONF_SHOW_CONFIGURABLE , CONF_SHOW_CONFIGURABLE_DATE , CONF_SHOW_GENERATION , CONF_STORE_STATISTICS , CONF_TARIFF ,
16- DOMAIN ,
16+ DOMAIN , PLATFORMS ,
1717)
1818from .services import DownloadStatisticsService
1919
20-
2120_LOGGER = logging .getLogger (__name__ )
2221
2322MIN_TIME_BETWEEN_UPDATES = datetime .timedelta (seconds = 600 )
@@ -51,9 +50,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):
5150 if DOMAIN not in hass .data :
5251 hass .data [DOMAIN ] = {}
5352
54- hass .async_create_task (
55- hass .config_entries .async_forward_entry_setup (config_entry , "sensor" )
56- )
53+ await hass .config_entries .async_forward_entry_setups (config_entry , PLATFORMS )
5754 config_entry .async_on_unload (config_entry .add_update_listener (async_reload_entry ))
5855 service = DownloadStatisticsService (hass )
5956 hass .services .async_register (service .domain , service .service , service .async_handle_service , service .schema )
@@ -62,7 +59,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):
6259
6360async def async_unload_entry (hass , config_entry ):
6461 """Unload a config entry."""
65- await hass .config_entries .async_forward_entry_unload (config_entry , "sensor" )
62+ await hass .config_entries .async_unload_platforms (config_entry , PLATFORMS )
6663 return True
6764
6865
0 commit comments