Round values to one decimal

Temperature detection range: -20 - 60 Deg.C ( + / - 0.3 Deg.C )
Humidity detection range: 0 - 100pct RH ( + / - 0.3pct )
Atmospheric pressure detection range: 30 - 110KPa ( + / - 120Pa )
This commit is contained in:
covrig 2018-01-15 20:01:59 +01:00 committed by GitHub
parent 079d4039a1
commit a3124a6aaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,5 +77,5 @@ class XiaomiSensor(XiaomiDevice):
return False
elif self._data_key == 'pressure' and value == 0:
return False
self._state = round(value, 2)
self._state = round(value, 1)
return True