From db2cb9c28daccf8c4ec92fece454b5d4c023451a Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sun, 9 Aug 2020 18:27:55 +0200 Subject: [PATCH] Fix zhimi.airfresh.va2 temperature (#794) --- miio/airfresh.py | 2 +- miio/tests/test_airfresh.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/miio/airfresh.py b/miio/airfresh.py index 5c776b297..59830ed09 100644 --- a/miio/airfresh.py +++ b/miio/airfresh.py @@ -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 diff --git a/miio/tests/test_airfresh.py b/miio/tests/test_airfresh.py index 7972002ce..cda2ed424 100644 --- a/miio/tests/test_airfresh.py +++ b/miio/tests/test_airfresh.py @@ -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, @@ -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"])