Skip to content
Snippets Groups Projects
Unverified Commit 74a12bb8 authored by Yuxin Wang's avatar Yuxin Wang Committed by GitHub
Browse files

Replace LASTSTEST with LAST_S_TEST (#124668)

parent 51fd8e12
No related branches found
No related tags found
No related merge requests found
......@@ -6,4 +6,4 @@ DOMAIN: Final = "apcupsd"
CONNECTION_TIMEOUT: int = 10
# Field name of last self test retrieved from apcupsd.
LASTSTEST: Final = "laststest"
LAST_S_TEST: Final = "laststest"
......@@ -25,7 +25,7 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN, LASTSTEST
from .const import DOMAIN, LAST_S_TEST
from .coordinator import APCUPSdCoordinator
PARALLEL_UPDATES = 0
......@@ -156,8 +156,8 @@ SENSORS: dict[str, SensorEntityDescription] = {
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
LASTSTEST: SensorEntityDescription(
key=LASTSTEST,
LAST_S_TEST: SensorEntityDescription(
key=LAST_S_TEST,
translation_key="last_self_test",
),
"lastxfer": SensorEntityDescription(
......@@ -422,7 +422,7 @@ async def async_setup_entry(
# periodical (or manual) self test since last daemon restart. It might not be available
# when we set up the integration, and we do not know if it would ever be available. Here we
# add it anyway and mark it as unknown initially.
for resource in available_resources | {LASTSTEST}:
for resource in available_resources | {LAST_S_TEST}:
if resource not in SENSORS:
_LOGGER.warning("Invalid resource from APCUPSd: %s", resource.upper())
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment