Use _attr_precision in entities (#77477)

This commit is contained in:
epenet 2022-08-29 22:02:29 +02:00 committed by GitHub
parent d4c020b675
commit e19e65908a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 14 additions and 73 deletions

View file

@ -106,6 +106,7 @@ class VenstarThermostat(VenstarEntity, ClimateEntity):
_attr_fan_modes = [FAN_ON, FAN_AUTO]
_attr_hvac_modes = [HVACMode.HEAT, HVACMode.COOL, HVACMode.OFF, HVACMode.AUTO]
_attr_precision = PRECISION_HALVES
def __init__(
self,
@ -139,15 +140,6 @@ class VenstarThermostat(VenstarEntity, ClimateEntity):
return features
@property
def precision(self):
"""Return the precision of the system.
Venstar temperature values are passed back and forth in the
API in C or F, with half-degree accuracy.
"""
return PRECISION_HALVES
@property
def temperature_unit(self):
"""Return the unit of measurement, as defined by the API."""