Skip to content

Commit

Permalink
Change from deprecated async_forward_entry_setup to async_forward_ent…
Browse files Browse the repository at this point in the history
…ry_setups (#83)
  • Loading branch information
toreamun authored Dec 25, 2024
1 parent 9ff146e commit b63b62b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions custom_components/amshan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from han import common as han_type, meter_connection, obis_map
from homeassistant import const as ha_const
from homeassistant.const import UnitOfReactivePower
from homeassistant.const import Platform, UnitOfReactivePower
from homeassistant.components import sensor as ha_sensor
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import CALLBACK_TYPE, callback, HomeAssistant, Event
Expand All @@ -27,8 +27,6 @@

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

PLATFORM_TYPE = ha_const.Platform.SENSOR

type AmsHanConfigEntry = ConfigEntry[AmsHanData]


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

config_entry.runtime_data = AmsHanData(integration)

await hass.config_entries.async_forward_entry_setup(config_entry, PLATFORM_TYPE)
await hass.config_entries.async_forward_entry_setups(config_entry, [Platform.SENSOR])

_LOGGER.debug("async_setup_entry complete.")

Expand Down Expand Up @@ -194,7 +192,7 @@ async def async_unload_entry(
) -> bool:
"""Handle removal of an entry."""
is_plaform_unload_success = await hass.config_entries.async_forward_entry_unload(
config_entry, PLATFORM_TYPE
config_entry, Platform.SENSOR
)

if is_plaform_unload_success:
Expand Down

0 comments on commit b63b62b

Please sign in to comment.