Skip to content

Commit eb103a8

Browse files
mchugh19frenck
authored andcommitted
Fix: Set EPH climate heating as on only when boiler is actively heating (home-assistant#152914)
1 parent 2b5f989 commit eb103a8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

homeassistant/components/ephember/climate.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
from __future__ import annotations
44

55
from datetime import timedelta
6+
from enum import IntEnum
67
import logging
78
from typing import Any
89

910
from pyephember2.pyephember2 import (
1011
EphEmber,
1112
ZoneMode,
13+
boiler_state,
1214
zone_current_temperature,
13-
zone_is_active,
1415
zone_is_hotwater,
1516
zone_mode,
1617
zone_name,
@@ -53,6 +54,15 @@
5354
"OFF": HVACMode.OFF,
5455
}
5556

57+
58+
class EPHBoilerStates(IntEnum):
59+
"""Boiler states for a zone given by the api."""
60+
61+
FIXME = 0
62+
OFF = 1
63+
ON = 2
64+
65+
5666
HA_STATE_TO_EPH = {value: key for key, value in EPH_TO_HA_STATE.items()}
5767

5868

@@ -123,7 +133,7 @@ def target_temperature(self) -> float | None:
123133
@property
124134
def hvac_action(self) -> HVACAction:
125135
"""Return current HVAC action."""
126-
if zone_is_active(self._zone):
136+
if boiler_state(self._zone) == EPHBoilerStates.ON:
127137
return HVACAction.HEATING
128138

129139
return HVACAction.IDLE

0 commit comments

Comments
 (0)