Skip to content

Commit

Permalink
added HumidityWarningRouleGroup.outdoorClimateSensor
Browse files Browse the repository at this point in the history
closes #185
  • Loading branch information
coreGreenberet committed Mar 2, 2019
1 parent 09cf654 commit 071bebe
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions homematicip/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
32 changes: 32 additions & 0 deletions tests/json_data/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
5 changes: 5 additions & 0 deletions tests/test_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 071bebe

Please sign in to comment.