Skip to content

Commit

Permalink
Ensure compatibility with Home Assistant 2025.1
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindwe committed Dec 21, 2024
1 parent 4867feb commit cef7240
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom_components/connectlife/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from homeassistant.components.water_heater import (
WaterHeaterEntity,
WaterHeaterEntityEntityDescription,
WaterHeaterEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
Expand All @@ -16,6 +15,7 @@
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import EntityDescription
from homeassistant.helpers.entity_platform import AddEntitiesCallback

from .const import (
Expand All @@ -36,6 +36,10 @@
_LOGGER = logging.getLogger(__name__)


class WaterHeaterEntityDescription(EntityDescription, frozen_or_thawed=True):
"""Class to avoid incompatibility with Home Assistant 2025.1."""


async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
Expand Down Expand Up @@ -88,7 +92,7 @@ def __init__(
"""Initialize the entity."""
super().__init__(coordinator, appliance, "waterheater", Platform.WATER_HEATER, config_entry)

self.entity_description = WaterHeaterEntityEntityDescription(
self.entity_description = WaterHeaterEntityDescription(
key=self._attr_unique_id,
name=appliance.device_nickname,
translation_key=DOMAIN
Expand Down

0 comments on commit cef7240

Please sign in to comment.