Skip to content

Commit 17ed771

Browse files
committed
Combine collection of Adam data
1 parent 21b6cae commit 17ed771

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

plugwise/__init__.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,25 @@ def _device_data_adam(
191191
) -> DeviceData:
192192
"""Helper-function for _get_device_data().
193193
194-
Determine Adam heating-status for on-off heating via valves.
194+
Determine Adam heating-status for on-off heating via valves,
195+
and available regulations_modes.
195196
"""
197+
if not self.smile(ADAM):
198+
return device_data
199+
196200
# Indicate heating_state based on valves being open in case of city-provided heating
197201
if (
198-
self.smile(ADAM)
199-
and device.get("dev_class") == "heater_central"
202+
device["dev_class"] == "heater_central"
200203
and self._on_off_device
201204
and isinstance(self._heating_valves(), int)
202205
):
203206
device_data["binary_sensors"]["heating_state"] = self._heating_valves() != 0
204207

208+
# Show the allowed regulation modes for Adam
209+
if device["dev_class"] == "gateway" and self._reg_allowed_modes:
210+
device_data["regulation_modes"] = self._reg_allowed_modes
211+
self._count += 1
212+
205213
return device_data
206214

207215
def _device_data_climate(
@@ -330,11 +338,6 @@ def _get_device_data(self, dev_id: str) -> DeviceData:
330338
device_data["sensors"]["outdoor_temperature"] = outdoor_temperature
331339
self._count += 1
332340

333-
# Show the allowed regulation modes for Adam
334-
if self._reg_allowed_modes:
335-
device_data["regulation_modes"] = self._reg_allowed_modes
336-
self._count += 1
337-
338341
# Show the allowed dhw_modes
339342
if device["dev_class"] == "heater_central" and self._dhw_allowed_modes:
340343
device_data["dhw_modes"] = self._dhw_allowed_modes

0 commit comments

Comments
 (0)