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

@ -64,16 +64,12 @@ async def async_setup_entry(
class FritzboxThermostat(FritzBoxEntity, ClimateEntity):
"""The thermostat class for FRITZ!SmartHome thermostats."""
_attr_precision = PRECISION_HALVES
_attr_supported_features = (
ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE
)
_attr_temperature_unit = TEMP_CELSIUS
@property
def precision(self) -> float:
"""Return precision 0.5."""
return PRECISION_HALVES
@property
def current_temperature(self) -> float:
"""Return the current temperature."""