|
9 | 9 | from plugwise.constants import ( |
10 | 10 | ADAM, |
11 | 11 | ANNA, |
| 12 | + LOGGER, |
12 | 13 | MAX_SETPOINT, |
13 | 14 | MIN_SETPOINT, |
14 | 15 | NONE, |
@@ -55,10 +56,13 @@ def _update_climates(self) -> None: |
55 | 56 |
|
56 | 57 | Collect data for each climate-location and add to self.climate_data. |
57 | 58 | """ |
| 59 | + LOGGER.debug("HOI 1 climates: %s", self.climate_data) |
58 | 60 | for location_id, climate in self.climate_data.items(): |
59 | 61 | data = self._get_location_data(location_id) |
60 | 62 | climate.update(data) |
61 | 63 |
|
| 64 | + |
| 65 | + |
62 | 66 | def _update_gw_devices(self) -> None: |
63 | 67 | """Helper-function for _all_device_data() and async_update(). |
64 | 68 |
|
@@ -156,7 +160,22 @@ def _get_location_data(self, loc_id: str) -> DeviceData: |
156 | 160 | Provide device-data, based on Location ID (= loc_id). |
157 | 161 | """ |
158 | 162 | climate = self.climate_data[loc_id] |
| 163 | + # data = self._get_climate_data(loc_id) |
| 164 | + if ctrl_state := self._control_state(loc_id): |
| 165 | + data["control_state"] = ctrl_state |
| 166 | + self._count += 1 |
| 167 | + |
| 168 | + # Thermostat data (presets, temperatures etc) |
| 169 | + self._device_data_climate(loc_id, climate, data) |
| 170 | + |
| 171 | + def _get_device_data(self, dev_id: str) -> DeviceData: |
| 172 | + """Helper-function for _all_device_data() and async_update(). |
| 173 | +
|
| 174 | + Provide device-data, based on appliance_id ()= dev_id). |
| 175 | + """ |
| 176 | + climate = self.climate_data[loc_id] |
159 | 177 | data = self._get_climate_data(loc_id) |
| 178 | + LOGGER.debug("HOI 2 climate: %s", data) |
160 | 179 | if ctrl_state := self._control_state(loc_id): |
161 | 180 | data["control_state"] = ctrl_state |
162 | 181 | self._count += 1 |
|
0 commit comments