Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waiting for config entry platforms #83

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading