mirror of
https://github.com/home-assistant/core.git
synced 2025-09-19 09:59:43 +00:00
Drop UNIT_ prefix for percentage constant (#39383)
This commit is contained in:
@@ -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"]
|
||||
)
|
||||
|
Reference in New Issue
Block a user