Skip to content

Commit b63b62b

Browse files
authored
Change from deprecated async_forward_entry_setup to async_forward_entry_setups (#83)
1 parent 9ff146e commit b63b62b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

custom_components/amshan/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from han import common as han_type, meter_connection, obis_map
1212
from homeassistant import const as ha_const
13-
from homeassistant.const import UnitOfReactivePower
13+
from homeassistant.const import Platform, UnitOfReactivePower
1414
from homeassistant.components import sensor as ha_sensor
1515
from homeassistant.config_entries import ConfigEntry
1616
from homeassistant.core import CALLBACK_TYPE, callback, HomeAssistant, Event
@@ -27,8 +27,6 @@
2727

2828
_LOGGER: logging.Logger = logging.getLogger(__name__)
2929

30-
PLATFORM_TYPE = ha_const.Platform.SENSOR
31-
3230
type AmsHanConfigEntry = ConfigEntry[AmsHanData]
3331

3432

@@ -140,7 +138,7 @@ async def on_hass_stop(event: Event) -> None:
140138

141139
config_entry.runtime_data = AmsHanData(integration)
142140

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])
144142

145143
_LOGGER.debug("async_setup_entry complete.")
146144

@@ -194,7 +192,7 @@ async def async_unload_entry(
194192
) -> bool:
195193
"""Handle removal of an entry."""
196194
is_plaform_unload_success = await hass.config_entries.async_forward_entry_unload(
197-
config_entry, PLATFORM_TYPE
195+
config_entry, Platform.SENSOR
198196
)
199197

200198
if is_plaform_unload_success:

0 commit comments

Comments
 (0)