Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zhimi.airfresh.va2 temperature #794

Merged
Merged
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
2 changes: 1 addition & 1 deletion miio/airfresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def humidity(self) -> int:
def temperature(self) -> Optional[float]:
"""Current temperature, if available."""
if self.data["temp_dec"] is not None:
return self.data["temp_dec"] / 10.0
return self.data["temp_dec"]

return None

Expand Down
4 changes: 2 additions & 2 deletions miio/tests/test_airfresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DummyAirFresh(DummyDevice, AirFresh):
def __init__(self, *args, **kwargs):
self.state = {
"power": "on",
"temp_dec": 186,
"temp_dec": 18.6,
"aqi": 10,
"average_aqi": 8,
"humidity": 62,
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_status(self):
assert self.is_on() is True
assert self.state().aqi == self.device.start_state["aqi"]
assert self.state().average_aqi == self.device.start_state["average_aqi"]
assert self.state().temperature == self.device.start_state["temp_dec"] / 10.0
assert self.state().temperature == self.device.start_state["temp_dec"]
assert self.state().humidity == self.device.start_state["humidity"]
assert self.state().co2 == self.device.start_state["co2"]
assert self.state().mode == OperationMode(self.device.start_state["mode"])
Expand Down