Drop UNIT_ prefix for percentage constant (#39383)

This commit is contained in:
springstan
2020-09-05 21:09:14 +02:00
committed by GitHub
parent cdc93d7110
commit d2b1918e9c
183 changed files with 639 additions and 661 deletions

View File

@@ -13,7 +13,7 @@ from homeassistant.const import (
CONF_NAME,
CONF_PORT,
CONF_RESOURCES,
UNIT_PERCENTAGE,
PERCENTAGE,
)
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
@@ -79,7 +79,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
try:
resource_data = netdata.api.metrics[sensor]
unit = (
UNIT_PERCENTAGE
PERCENTAGE
if resource_data["units"] == "percentage"
else resource_data["units"]
)