From 904bf682bbfe07b8959b6bcf151646013395e2bc Mon Sep 17 00:00:00 2001 From: Olaf Mandel Date: Sat, 5 Oct 2024 23:34:26 +0200 Subject: [PATCH] Fix AVM DECT440 on older FRITZ!OS On FRITZ!OS < 7.20, the DECT440 is reported with `functionsbitmask` containing the `HUMIDITY` feature, but the device-node does not actually contain that element. So patch the `functionsbitmask` if that situation is detected. --- pyfritzhome/devicetypes/fritzhomeentitybase.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyfritzhome/devicetypes/fritzhomeentitybase.py b/pyfritzhome/devicetypes/fritzhomeentitybase.py index 7a8e437..ba17af5 100644 --- a/pyfritzhome/devicetypes/fritzhomeentitybase.py +++ b/pyfritzhome/devicetypes/fritzhomeentitybase.py @@ -42,6 +42,12 @@ def _update_from_node(self, node): self.ain = node.attrib["identifier"] self._functionsbitmask = int(node.attrib["functionbitmask"]) + # Workaround for broken AVM FRITZ!DECT 440 in FRITZ!OS < 7.20 + if (node.attrib["manufacturer"] == "AVM" + and node.attrib["productname"] == "FRITZ!DECT 440" + and node.find("humidity") is None): + self._functionsbitmask &= ~int(FritzhomeDeviceFeatures.HUMIDITY) + self.name = node.findtext("name").strip() self.supported_features = []