From b2bd68a4a0883c5fdee597202df63f1529b853d9 Mon Sep 17 00:00:00 2001 From: "Julien \"_FrnchFrgg_\" Rivaud" Date: Sat, 21 Nov 2020 06:06:50 +0100 Subject: [PATCH] =?UTF-8?q?Avoid=20arbitrarily=20reducing=20ZHA=C2=A0clima?= =?UTF-8?q?te=20temperature=20information=20(#43442)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Zigbee specification mandates that temperatures are given in 1/100ths of degrees, and several devices are able to provide temperature readings or accept target temperature settings with precision equal or better than 0.1°C. Yet the ZHA climate entity implementation advertises an hard-coded precision of 0.5°C. Avoid arbitrary coarsening by advertising 0.1°C precision, as passing through the full 0.01°C precision is probably not that useful. --- homeassistant/components/zha/climate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/zha/climate.py b/homeassistant/components/zha/climate.py index 728d0f48217..ab0f15f7559 100644 --- a/homeassistant/components/zha/climate.py +++ b/homeassistant/components/zha/climate.py @@ -36,7 +36,7 @@ from homeassistant.components.climate.const import ( SUPPORT_TARGET_TEMPERATURE, SUPPORT_TARGET_TEMPERATURE_RANGE, ) -from homeassistant.const import ATTR_TEMPERATURE, PRECISION_HALVES, TEMP_CELSIUS +from homeassistant.const import ATTR_TEMPERATURE, PRECISION_TENTHS, TEMP_CELSIUS from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.event import async_track_time_interval @@ -287,7 +287,7 @@ class Thermostat(ZhaEntity, ClimateEntity): @property def precision(self): """Return the precision of the system.""" - return PRECISION_HALVES + return PRECISION_TENTHS @property def preset_mode(self) -> Optional[str]: