77from homeassistant .helpers .entity import Entity
88
99from homeassistant .components .climate .const import (
10+ CURRENT_HVAC_COOL ,
1011 CURRENT_HVAC_HEAT ,
1112 CURRENT_HVAC_IDLE ,
1213)
1314
1415from .const import (
1516 CURRENT_HVAC_DHW ,
1617 DOMAIN ,
18+ COOL_ICON ,
1719 FLAME_ICON ,
1820 IDLE_ICON ,
1921 WATER_HEATER_ICON ,
@@ -50,11 +52,12 @@ def __init__(self, api, updater, name, dev_id):
5052 self ._updater = updater
5153 self ._name = name
5254 self ._dev_id = dev_id
53- self ._boiler_state = False
5455 self ._boiler_temp = None
55- self ._central_heating_state = False
56+ self ._boiler_state = None
57+ self ._central_heating_state = None
58+ self ._cooling_state = None
59+ self ._domestic_hot_water_state = None
5660 self ._central_heater_water_pressure = None
57- self ._domestic_hot_water_state = False
5861 self ._unique_id = f"{ dev_id } -water_heater"
5962
6063 @property
@@ -98,6 +101,8 @@ def state(self):
98101 return CURRENT_HVAC_HEAT
99102 if self ._domestic_hot_water_state :
100103 return CURRENT_HVAC_DHW
104+ if self ._cooling_state :
105+ return CURRENT_HVAC_COOL
101106 return CURRENT_HVAC_IDLE
102107
103108 @property
@@ -116,6 +121,8 @@ def icon(self):
116121 return FLAME_ICON
117122 if self ._domestic_hot_water_state :
118123 return WATER_HEATER_ICON
124+ if self ._cooling_state :
125+ return COOL_ICON
119126 return IDLE_ICON
120127
121128 @property
@@ -143,5 +150,8 @@ def update(self):
143150 if "central_heating_state" in data :
144151 if data ["central_heating_state" ] is not None :
145152 self ._central_heating_state = data ["central_heating_state" ]
153+ if "cooling_state" in data :
154+ if data ["cooling_state" ] is not None :
155+ self ._boiler_state = data ["boiler_state" ]
146156 if "domestic_hot_water_state" in data :
147157 self ._domestic_hot_water_state = data ["domestic_hot_water_state" ]
0 commit comments