Skip to content

Commit ef66430

Browse files
committed
Add cooling to water_heater
1 parent ae6a0c1 commit ef66430

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

custom_components/plugwise-beta/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
THERMOSTAT_ICON = "mdi:thermometer"
3232
WATER_HEATER_ICON = "mdi:water-pump"
3333
FLAME_ICON = "mdi:fire"
34+
COOL_ICON = "mdi:snowflake"
3435
IDLE_ICON = "mdi:circle-off-outline"
3536
GAS_ICON = "mdi:fire"
3637
POWER_ICON = "mdi:flash"

custom_components/plugwise-beta/water_heater.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
from homeassistant.helpers.entity import Entity
88

99
from homeassistant.components.climate.const import (
10+
CURRENT_HVAC_COOL,
1011
CURRENT_HVAC_HEAT,
1112
CURRENT_HVAC_IDLE,
1213
)
1314

1415
from .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

Comments
 (0)