Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions aiolyric/objects/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,40 @@ def circulation_fan_request(self):
return self.attributes.get("circulationFanRequest", False)


class HeatAndCoolDemand(LyricBaseObject):
"""Heat and cool demand."""

@property
def current_stage(self):
"""Return the current equipment stage."""
return self.attributes.get("CurrentStage", None)

@property
def demand(self):
"""Return the demand percentage."""
return self.attributes.get("Demand", None)

@property
def mode(self):
"""Return the mode."""
return self.attributes.get("Mode", None)

@property
def stages_on(self):
"""Return which equipment stages are on."""
return self.attributes.get("StagesOn", [])

@property
def fan_request(self):
"""Return the fan request."""
return self.attributes.get("FanRequest", False)

@property
def circulation_fan_request(self):
"""Return the circulation fan request."""
return self.attributes.get("CirculationFanRequest", False)


class LyricDevice(LyricBaseClient):
"""Lyric Device."""

Expand Down Expand Up @@ -364,6 +398,11 @@ def operation_status(self):
"""Return the operation status."""
return OperationStatus(self.attributes.get("operationStatus", {}))

@property
def heat_and_cool_demand(self):
"""Return the heat and cool demand."""
return HeatAndCoolDemand(self.attributes.get("heatAndCoolDemand", {}))

@property
def device_model(self):
"""Return the device model."""
Expand Down
16 changes: 16 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@
"fanRequest": False,
"circulationFanRequest": False,
},
"heatAndCoolDemand": {
"CurrentStage": 1,
"Demand": 33,
"Mode": "Cool",
"StagesOn": [True, False, False, False],
"FanRequest": True,
"CirculationFanRequest": False,
},
"deviceModel": "T5-T6",
"fanMode": "Auto",
}
Expand Down Expand Up @@ -127,6 +135,14 @@
"fanRequest": False,
"circulationFanRequest": False,
},
"heatAndCoolDemand": {
"CurrentStage": 1,
"Demand": 33,
"Mode": "Cool",
"StagesOn": [True, False, False, False],
"FanRequest": True,
"CirculationFanRequest": False,
},
"deviceModel": "T5-T6",
}
],
Expand Down
24 changes: 24 additions & 0 deletions tests/objects/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,29 @@ def test_device(
obj.operation_status.circulation_fan_request
== device_fixture_response["operationStatus"]["circulationFanRequest"]
)
assert (
obj.heat_and_cool_demand.current_stage
== device_fixture_response["heatAndCoolDemand"]["CurrentStage"]
)
assert (
obj.heat_and_cool_demand.demand
== device_fixture_response["heatAndCoolDemand"]["Demand"]
)
assert (
obj.heat_and_cool_demand.mode
== device_fixture_response["heatAndCoolDemand"]["Mode"]
)
assert (
obj.heat_and_cool_demand.stages_on
== device_fixture_response["heatAndCoolDemand"]["StagesOn"]
)
assert (
obj.heat_and_cool_demand.fan_request
== device_fixture_response["heatAndCoolDemand"]["FanRequest"]
)
assert (
obj.heat_and_cool_demand.circulation_fan_request
== device_fixture_response["heatAndCoolDemand"]["CirculationFanRequest"]
)
assert obj.device_model == device_fixture_response["deviceModel"]
assert obj.fan_mode == device_fixture_response["fanMode"]
26 changes: 26 additions & 0 deletions tests/objects/test_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,32 @@ def test_location(
"circulationFanRequest"
]
)
assert (
obj.devices[0].heat_and_cool_demand.current_stage
== location_fixture_response["devices"][0]["heatAndCoolDemand"]["CurrentStage"]
)
assert (
obj.devices[0].heat_and_cool_demand.demand
== location_fixture_response["devices"][0]["heatAndCoolDemand"]["Demand"]
)
assert (
obj.devices[0].heat_and_cool_demand.mode
== location_fixture_response["devices"][0]["heatAndCoolDemand"]["Mode"]
)
assert (
obj.devices[0].heat_and_cool_demand.stages_on
== location_fixture_response["devices"][0]["heatAndCoolDemand"]["StagesOn"]
)
assert (
obj.devices[0].heat_and_cool_demand.fan_request
== location_fixture_response["devices"][0]["heatAndCoolDemand"]["FanRequest"]
)
assert (
obj.devices[0].heat_and_cool_demand.circulation_fan_request
== location_fixture_response["devices"][0]["heatAndCoolDemand"][
"CirculationFanRequest"
]
)
assert (
obj.devices[0].device_model
== location_fixture_response["devices"][0]["deviceModel"]
Expand Down