Use typed config entry in fyta (#132248)

This commit is contained in:
epenet 2024-12-04 09:52:31 +01:00 committed by GitHub
parent 6b7724c556
commit cafd2092d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -55,13 +55,15 @@ async def async_setup_entry(hass: HomeAssistant, entry: FytaConfigEntry) -> bool
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: FytaConfigEntry) -> bool:
"""Unload Fyta entity."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
async def async_migrate_entry(
hass: HomeAssistant, config_entry: FytaConfigEntry
) -> bool:
"""Migrate old entry."""
_LOGGER.debug("Migrating from version %s", config_entry.version)

View File

@ -3,10 +3,10 @@
from fyta_cli.fyta_models import Plant
from homeassistant.components.sensor import SensorEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import FytaConfigEntry
from .const import DOMAIN
from .coordinator import FytaCoordinator
@ -19,7 +19,7 @@ class FytaPlantEntity(CoordinatorEntity[FytaCoordinator]):
def __init__(
self,
coordinator: FytaCoordinator,
entry: ConfigEntry,
entry: FytaConfigEntry,
description: SensorEntityDescription,
plant_id: int,
) -> None: