mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Use typed config entry in fyta (#132248)
This commit is contained in:
parent
6b7724c556
commit
cafd2092d4
@ -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)
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user