Avoid arbitrarily reducing ZHA climate temperature information (#43442)

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.
pull/43473/head
Julien "_FrnchFrgg_" Rivaud 2020-11-21 06:06:50 +01:00 committed by GitHub
parent db60a71603
commit b2bd68a4a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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]: