Add and use percentage constant (#32094)
* Add and use percentage constant * Fix pylint error and broken test
This commit is contained in:
parent
c7f128f286
commit
f1a0ca7cd3
155 changed files with 735 additions and 459 deletions
|
@ -33,6 +33,7 @@ from homeassistant.const import (
|
|||
POWER_WATT,
|
||||
SPEED_KILOMETERS_PER_HOUR,
|
||||
TEMP_CELSIUS,
|
||||
UNIT_PERCENTAGE,
|
||||
)
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
|
||||
|
@ -155,7 +156,7 @@ class HomematicipAccesspointStatus(HomematicipGenericDevice):
|
|||
@property
|
||||
def unit_of_measurement(self) -> str:
|
||||
"""Return the unit this state is expressed in."""
|
||||
return "%"
|
||||
return UNIT_PERCENTAGE
|
||||
|
||||
@property
|
||||
def device_state_attributes(self) -> Dict[str, Any]:
|
||||
|
@ -194,7 +195,7 @@ class HomematicipHeatingThermostat(HomematicipGenericDevice):
|
|||
@property
|
||||
def unit_of_measurement(self) -> str:
|
||||
"""Return the unit this state is expressed in."""
|
||||
return "%"
|
||||
return UNIT_PERCENTAGE
|
||||
|
||||
|
||||
class HomematicipHumiditySensor(HomematicipGenericDevice):
|
||||
|
@ -217,7 +218,7 @@ class HomematicipHumiditySensor(HomematicipGenericDevice):
|
|||
@property
|
||||
def unit_of_measurement(self) -> str:
|
||||
"""Return the unit this state is expressed in."""
|
||||
return "%"
|
||||
return UNIT_PERCENTAGE
|
||||
|
||||
|
||||
class HomematicipTemperatureSensor(HomematicipGenericDevice):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue