|
26 | 26 | OBSOLETE_MEASUREMENTS, |
27 | 27 | P1_LEGACY_MEASUREMENTS, |
28 | 28 | SENSORS, |
29 | | - SPECIAL_PLUG_TYPES, |
30 | 29 | SPECIALS, |
31 | 30 | SWITCHES, |
32 | 31 | TEMP_CELSIUS, |
@@ -282,7 +281,7 @@ def _get_measurement_data(self, dev_id: str) -> DeviceData: |
282 | 281 | appliance := self._appliances.find(f'./appliance[@id="{dev_id}"]') |
283 | 282 | ) is not None: |
284 | 283 | self._appliance_measurements(appliance, data, measurements) |
285 | | - self._get_lock_state(appliance, data) |
| 284 | + self._get_lock_state(appliance, data, self._stretch_v2) |
286 | 285 |
|
287 | 286 | if appliance.find("type").text in ACTUATOR_CLASSES: |
288 | 287 | self._get_actuator_functionalities(appliance, device, data) |
@@ -438,22 +437,6 @@ def _appliance_measurements( |
438 | 437 | # Don't count the above top-level dicts, only the remaining single items |
439 | 438 | self._count += len(data) - 3 |
440 | 439 |
|
441 | | - def _get_lock_state(self, xml: etree, data: DeviceData) -> None: |
442 | | - """Helper-function for _get_measurement_data(). |
443 | | -
|
444 | | - Adam & Stretches: obtain the relay-switch lock state. |
445 | | - """ |
446 | | - actuator = "actuator_functionalities" |
447 | | - func_type = "relay_functionality" |
448 | | - if self._stretch_v2: |
449 | | - actuator = "actuators" |
450 | | - func_type = "relay" |
451 | | - if xml.find("type").text not in SPECIAL_PLUG_TYPES: |
452 | | - locator = f"./{actuator}/{func_type}/lock" |
453 | | - if (found := xml.find(locator)) is not None: |
454 | | - data["switches"]["lock"] = found.text == "true" |
455 | | - self._count += 1 |
456 | | - |
457 | 440 | def _get_actuator_functionalities( |
458 | 441 | self, xml: etree, device: DeviceData, data: DeviceData |
459 | 442 | ) -> None: |
|
0 commit comments