From 27a9f5a05c6a886ef5e5717c672d2c4074bb84c9 Mon Sep 17 00:00:00 2001 From: Maciej Bieniek Date: Fri, 4 Jan 2019 18:25:37 +0100 Subject: [PATCH] Round illumination and lux value to one (#19747) --- homeassistant/components/sensor/xiaomi_aqara.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/xiaomi_aqara.py b/homeassistant/components/sensor/xiaomi_aqara.py index 33517e957b9..1859b7be16a 100644 --- a/homeassistant/components/sensor/xiaomi_aqara.py +++ b/homeassistant/components/sensor/xiaomi_aqara.py @@ -107,5 +107,8 @@ class XiaomiSensor(XiaomiDevice): return False if self._data_key == 'pressure' and value == 0: return False - self._state = round(value, 1) + if self._data_key in ['illumination', 'lux']: + self._state = round(value) + else: + self._state = round(value, 1) return True