mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 10:59:40 +00:00
Migrate APCUPSD to has entity name (#112997)
* Properly set entity names for APCUPSD * Add test cases to prevent future regressions * Fix tests due to the updated entity IDs * Prettify code * Remove redundant translation key
This commit is contained in:
@@ -20,7 +20,6 @@ from .coordinator import APCUPSdCoordinator
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
_DESCRIPTION = BinarySensorEntityDescription(
|
||||
key="statflag",
|
||||
name="UPS Online Status",
|
||||
translation_key="online_status",
|
||||
)
|
||||
# The bit in STATFLAG that indicates the online status of the APC UPS.
|
||||
@@ -46,6 +45,8 @@ async def async_setup_entry(
|
||||
class OnlineStatus(CoordinatorEntity[APCUPSdCoordinator], BinarySensorEntity):
|
||||
"""Representation of a UPS online status."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
coordinator: APCUPSdCoordinator,
|
||||
|
||||
Reference in New Issue
Block a user