|
10 | 10 |
|
11 | 11 | from han import common as han_type, meter_connection, obis_map
|
12 | 12 | from homeassistant import const as ha_const
|
13 |
| -from homeassistant.const import UnitOfReactivePower |
| 13 | +from homeassistant.const import Platform, UnitOfReactivePower |
14 | 14 | from homeassistant.components import sensor as ha_sensor
|
15 | 15 | from homeassistant.config_entries import ConfigEntry
|
16 | 16 | from homeassistant.core import CALLBACK_TYPE, callback, HomeAssistant, Event
|
|
27 | 27 |
|
28 | 28 | _LOGGER: logging.Logger = logging.getLogger(__name__)
|
29 | 29 |
|
30 |
| -PLATFORM_TYPE = ha_const.Platform.SENSOR |
31 |
| - |
32 | 30 | type AmsHanConfigEntry = ConfigEntry[AmsHanData]
|
33 | 31 |
|
34 | 32 |
|
@@ -140,7 +138,7 @@ async def on_hass_stop(event: Event) -> None:
|
140 | 138 |
|
141 | 139 | config_entry.runtime_data = AmsHanData(integration)
|
142 | 140 |
|
143 |
| - await hass.config_entries.async_forward_entry_setup(config_entry, PLATFORM_TYPE) |
| 141 | + await hass.config_entries.async_forward_entry_setups(config_entry, [Platform.SENSOR]) |
144 | 142 |
|
145 | 143 | _LOGGER.debug("async_setup_entry complete.")
|
146 | 144 |
|
@@ -194,7 +192,7 @@ async def async_unload_entry(
|
194 | 192 | ) -> bool:
|
195 | 193 | """Handle removal of an entry."""
|
196 | 194 | is_plaform_unload_success = await hass.config_entries.async_forward_entry_unload(
|
197 |
| - config_entry, PLATFORM_TYPE |
| 195 | + config_entry, Platform.SENSOR |
198 | 196 | )
|
199 | 197 |
|
200 | 198 | if is_plaform_unload_success:
|
|
0 commit comments