Skip to content

Commit 315febe

Browse files
🔭 Compatibility with HA 2025.1
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
1 parent fdebb82 commit 315febe

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

‎custom_components/aquarea/water_heater.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@
1111
from homeassistant.components.mqtt.client import async_publish
1212

1313
from homeassistant.components.water_heater import (
14-
WaterHeaterEntityEntityDescription,
1514
WaterHeaterEntity,
1615
WaterHeaterEntityFeature,
1716
STATE_ECO,
1817
STATE_PERFORMANCE,
1918
)
19+
try:
20+
from homeassistant.components.water_heater import WaterHeaterEntityDescription
21+
except ImportError:
22+
# compatibility code for HA < 2025.1
23+
from homeassistant.components.water_heater import WaterHeaterEntityEntityDescription
24+
WaterHeaterEntityDescription = WaterHeaterEntityEntityDescription
25+
26+
2027

2128
from .definitions import OperatingMode
2229
from . import build_device_info
@@ -37,7 +44,7 @@ async def async_setup_entry(
3744
f"Starting bootstrap of water heater entities with prefix '{discovery_prefix}'"
3845
)
3946
"""Set up HeishaMon water heater from config entry."""
40-
description = WaterHeaterEntityEntityDescription(
47+
description = WaterHeaterEntityDescription(
4148
key=f"{discovery_prefix}main/DHW_Target_Temp",
4249
name="Aquarea Domestic Water Heater",
4350
)
@@ -62,7 +69,7 @@ class HeishaMonDHW(WaterHeaterEntity):
6269
def __init__(
6370
self,
6471
hass: HomeAssistant,
65-
description: WaterHeaterEntityEntityDescription,
72+
description: WaterHeaterEntityDescription,
6673
config_entry: ConfigEntry,
6774
) -> None:
6875
"""Initialize the water heater entity."""

0 commit comments

Comments
 (0)