Use _attr_temperature_unit in climate entities (#77472)

This commit is contained in:
epenet 2022-08-29 10:20:55 +02:00 committed by GitHub
parent 8ed689fede
commit 0c401bcab2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 28 additions and 114 deletions

View file

@ -35,6 +35,8 @@ async def async_setup_entry(
class SpiderThermostat(ClimateEntity):
"""Representation of a thermostat."""
_attr_temperature_unit = TEMP_CELSIUS
def __init__(self, api, thermostat):
"""Initialize the thermostat."""
self.api = api
@ -75,11 +77,6 @@ class SpiderThermostat(ClimateEntity):
"""Return the name of the thermostat, if any."""
return self.thermostat.name
@property
def temperature_unit(self):
"""Return the unit of measurement."""
return TEMP_CELSIUS
@property
def current_temperature(self):
"""Return the current temperature."""