Skip to content

Commit

Permalink
🔭 Compatibility with HA 2025.1
Browse files Browse the repository at this point in the history
home-assistant/core#132888 broke backward
compatibility.
This patch will make this integration compatible with 2025.1 and still
be backward compatible with earlier version
  • Loading branch information
kamaradclimber committed Dec 14, 2024
1 parent fdebb82 commit 315febe
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions custom_components/aquarea/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@
from homeassistant.components.mqtt.client import async_publish

from homeassistant.components.water_heater import (
WaterHeaterEntityEntityDescription,
WaterHeaterEntity,
WaterHeaterEntityFeature,
STATE_ECO,
STATE_PERFORMANCE,
)
try:
from homeassistant.components.water_heater import WaterHeaterEntityDescription
except ImportError:
# compatibility code for HA < 2025.1
from homeassistant.components.water_heater import WaterHeaterEntityEntityDescription
WaterHeaterEntityDescription = WaterHeaterEntityEntityDescription



from .definitions import OperatingMode
from . import build_device_info
Expand All @@ -37,7 +44,7 @@ async def async_setup_entry(
f"Starting bootstrap of water heater entities with prefix '{discovery_prefix}'"
)
"""Set up HeishaMon water heater from config entry."""
description = WaterHeaterEntityEntityDescription(
description = WaterHeaterEntityDescription(
key=f"{discovery_prefix}main/DHW_Target_Temp",
name="Aquarea Domestic Water Heater",
)
Expand All @@ -62,7 +69,7 @@ class HeishaMonDHW(WaterHeaterEntity):
def __init__(
self,
hass: HomeAssistant,
description: WaterHeaterEntityEntityDescription,
description: WaterHeaterEntityDescription,
config_entry: ConfigEntry,
) -> None:
"""Initialize the water heater entity."""
Expand Down

0 comments on commit 315febe

Please sign in to comment.