Add and use percentage constant (#32094)

* Add and use percentage constant

* Fix pylint error and broken test
This commit is contained in:
springstan 2020-02-28 20:46:48 +01:00 committed by GitHub
parent c7f128f286
commit f1a0ca7cd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
155 changed files with 735 additions and 459 deletions

View file

@ -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):