Round illumination and lux value to one (#19747)

This commit is contained in:
Maciej Bieniek 2019-01-04 18:25:37 +01:00 committed by Sebastian Muszynski
parent 16ab799798
commit 27a9f5a05c

View File

@ -107,5 +107,8 @@ class XiaomiSensor(XiaomiDevice):
return False return False
if self._data_key == 'pressure' and value == 0: if self._data_key == 'pressure' and value == 0:
return False return False
if self._data_key in ['illumination', 'lux']:
self._state = round(value)
else:
self._state = round(value, 1) self._state = round(value, 1)
return True return True