From 74a12bb8029f856948a6ef80c867ad091f0f4d48 Mon Sep 17 00:00:00 2001 From: Yuxin Wang <yuxinwang.dev@gmail.com> Date: Tue, 27 Aug 2024 00:50:15 -0400 Subject: [PATCH] Replace LASTSTEST with LAST_S_TEST (#124668) --- homeassistant/components/apcupsd/const.py | 2 +- homeassistant/components/apcupsd/sensor.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/apcupsd/const.py b/homeassistant/components/apcupsd/const.py index 56bf229579d..974c860afb8 100644 --- a/homeassistant/components/apcupsd/const.py +++ b/homeassistant/components/apcupsd/const.py @@ -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" diff --git a/homeassistant/components/apcupsd/sensor.py b/homeassistant/components/apcupsd/sensor.py index f2b5943bdf0..d4bbfb148e5 100644 --- a/homeassistant/components/apcupsd/sensor.py +++ b/homeassistant/components/apcupsd/sensor.py @@ -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 -- GitLab