diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f3fef58..f1c08571 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - API - AutoNameEnum.from_str does now take a default parameter_ - HeatingThermostat.**valveActualTemperature** = we are now able to read the measured temperature on the VALVE! + - Async/HeatingFailureAlertRuleGroup ## [0.10.5] - 2019-01-26 ### Added diff --git a/homematicip/group.py b/homematicip/group.py index 5942df28..3b564d3e 100644 --- a/homematicip/group.py +++ b/homematicip/group.py @@ -719,8 +719,13 @@ def from_json(self, js, devices): self.lastExecutionTimestamp = self.fromtimestamp(js["lastExecutionTimestamp"]) self.lastStatusUpdate = self.fromtimestamp(js["lastStatusUpdate"]) - # TODO - # self.outdoorClimateSensor + jsOutdoorClimateSensor = js["outdoorClimateSensor"] + if jsOutdoorClimateSensor != None: + did = jsOutdoorClimateSensor["deviceId"] + for d in devices: + if d.id == did: + self.outdoorClimateSensor = d + break def __str__(self): return ( diff --git a/tests/json_data/home.json b/tests/json_data/home.json index fef4c62c..053b166e 100644 --- a/tests/json_data/home.json +++ b/tests/json_data/home.json @@ -4460,6 +4460,38 @@ "type": "HUMIDITY_WARNING_RULE_GROUP", "unreach": false, "ventilationRecommended": true + }, + "00000000-0000-0000-0000-000000000049": { + "channels": [ + { + "channelIndex": 1, + "deviceId": "3014F7110000000000000038" + }, + { + "channelIndex": 1, + "deviceId": "3014F7110000000000000023" + } + ], + "dutyCycle": false, + "enabled": true, + "homeId": "00000000-0000-0000-0000-000000000001", + "humidityLowerThreshold": 30, + "humidityUpperThreshold": 60, + "humidityValidationResult": null, + "id": "00000000-0000-0000-0000-000000000049", + "label": "Schlafzimmer", + "lastExecutionTimestamp": 0, + "lastStatusUpdate": 1551003370150, + "lowBat": false, + "metaGroupId": "00000000-0000-0000-0000-000000000008", + "outdoorClimateSensor": { + "channelIndex": 1, + "deviceId": "3014F7110000000000000038" + }, + "triggered": false, + "type": "HUMIDITY_WARNING_RULE_GROUP", + "unreach": false, + "ventilationRecommended": false } }, "home": { diff --git a/tests/test_groups.py b/tests/test_groups.py index a7baf1b3..4c6a3188 100644 --- a/tests/test_groups.py +++ b/tests/test_groups.py @@ -345,7 +345,12 @@ def test_humidity_warning_rule_group(fake_home: Home): "triggered(False) lastExecutionTimestamp(2019-02-28 22:05:05.665000) " "lastStatusUpdate(2019-02-28 22:08:24.260000) ventilationRecommended(True)" ) + assert g.outdoorClimateSensor == None + g = fake_home.search_group_by_id("00000000-0000-0000-0000-000000000049") + d = fake_home.search_device_by_id("3014F7110000000000000038") + assert g.outdoorClimateSensor == d + def test_all_groups_implemented(fake_home: Home): for g in fake_home.groups: