Add and use percentage constant (#32094)
* Add and use percentage constant * Fix pylint error and broken test
This commit is contained in:
1 parent
c7f128f286
commit
f1a0ca7cd3
155 files changed
+735
-459
No files matched your search
@@ -1,7 +1,7 @@
|
||||
"""Support for Tado sensors for each zone."""
|
||||
import logging
|
||||
|
||||
from homeassistant.const import TEMP_CELSIUS
|
||||
from homeassistant.const import TEMP_CELSIUS, UNIT_PERCENTAGE
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity import Entity
|
||||
@@ -134,9 +134,9 @@ class TadoSensor(Entity):
|
||||
if self.zone_variable == "temperature":
|
||||
return self.hass.config.units.temperature_unit
|
||||
if self.zone_variable == "humidity":
|
||||
return "%"
|
||||
return UNIT_PERCENTAGE
|
||||
if self.zone_variable == "heating":
|
||||
return "%"
|
||||
return UNIT_PERCENTAGE
|
||||
if self.zone_variable == "ac":
|
||||
return ""
|
||||
|
||||
|
||||
Reference in new issue
Block a user