Skip to content

Commit

Permalink
Fix zhimi.airfresh.va2 temperature (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Aug 9, 2020
1 parent b0dfc76 commit db2cb9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit db2cb9c

Please sign in to comment.