Skip to content

Commit 2b69b2a

Browse files
committed
Add back setting self._cooling_enabled at top-level
1 parent 12d2566 commit 2b69b2a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

plugwise/smile.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,15 @@ async def async_update(self) -> PlugwiseData:
130130
try:
131131
await self.full_xml_update()
132132
self.get_all_gateway_entities()
133-
# Check for a failed data-retrieval
134-
_ = self.gw_entities[self.gw_data["gateway_id"]]
133+
# Set self._cooling_enabled -required for set_temperature,
134+
#also, check for a failed data-retrieval
135+
if "heater_id" in self.gw_data:
136+
heat_cooler = self.gw_entities[self.gw_data["heater_id"]]
137+
if (
138+
"binary_sensors" in heat_cooler
139+
and "cooling_enabled" in heat_cooler["binary_sensors"]
140+
):
141+
self._cooling_enabled = heat_cooler["binary_sensors"]["cooling_enabled"]
135142
except KeyError as err:
136143
raise DataMissingError("No Plugwise data received") from err
137144

0 commit comments

Comments
 (0)