Skip to content

Commit

Permalink
Use typed config entry in fyta (home-assistant#132248)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Dec 4, 2024
1 parent 6b7724c commit cafd209
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions homeassistant/components/fyta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/fyta/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -19,7 +19,7 @@ class FytaPlantEntity(CoordinatorEntity[FytaCoordinator]):
def __init__(
self,
coordinator: FytaCoordinator,
entry: ConfigEntry,
entry: FytaConfigEntry,
description: SensorEntityDescription,
plant_id: int,
) -> None:
Expand Down

0 comments on commit cafd209

Please sign in to comment.