mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Migrate Uptimerobot to has entity name (#96770)
This commit is contained in:
parent
13fd5a59e3
commit
44803e1177
@ -27,7 +27,6 @@ async def async_setup_entry(
|
|||||||
coordinator,
|
coordinator,
|
||||||
BinarySensorEntityDescription(
|
BinarySensorEntityDescription(
|
||||||
key=str(monitor.id),
|
key=str(monitor.id),
|
||||||
name=monitor.friendly_name,
|
|
||||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||||
),
|
),
|
||||||
monitor=monitor,
|
monitor=monitor,
|
||||||
|
@ -15,6 +15,8 @@ class UptimeRobotEntity(CoordinatorEntity[UptimeRobotDataUpdateCoordinator]):
|
|||||||
"""Base UptimeRobot entity."""
|
"""Base UptimeRobot entity."""
|
||||||
|
|
||||||
_attr_attribution = ATTRIBUTION
|
_attr_attribution = ATTRIBUTION
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
_attr_name = None
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
@ -46,7 +46,6 @@ async def async_setup_entry(
|
|||||||
coordinator,
|
coordinator,
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=str(monitor.id),
|
key=str(monitor.id),
|
||||||
name=monitor.friendly_name,
|
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
device_class=SensorDeviceClass.ENUM,
|
device_class=SensorDeviceClass.ENUM,
|
||||||
options=["down", "not_checked_yet", "pause", "seems_down", "up"],
|
options=["down", "not_checked_yet", "pause", "seems_down", "up"],
|
||||||
|
@ -29,7 +29,6 @@ async def async_setup_entry(
|
|||||||
coordinator,
|
coordinator,
|
||||||
SwitchEntityDescription(
|
SwitchEntityDescription(
|
||||||
key=str(monitor.id),
|
key=str(monitor.id),
|
||||||
name=f"{monitor.friendly_name} Active",
|
|
||||||
device_class=SwitchDeviceClass.SWITCH,
|
device_class=SwitchDeviceClass.SWITCH,
|
||||||
),
|
),
|
||||||
monitor=monitor,
|
monitor=monitor,
|
||||||
|
@ -66,7 +66,7 @@ STATE_UP = "up"
|
|||||||
|
|
||||||
UPTIMEROBOT_BINARY_SENSOR_TEST_ENTITY = "binary_sensor.test_monitor"
|
UPTIMEROBOT_BINARY_SENSOR_TEST_ENTITY = "binary_sensor.test_monitor"
|
||||||
UPTIMEROBOT_SENSOR_TEST_ENTITY = "sensor.test_monitor"
|
UPTIMEROBOT_SENSOR_TEST_ENTITY = "sensor.test_monitor"
|
||||||
UPTIMEROBOT_SWITCH_TEST_ENTITY = "switch.test_monitor_active"
|
UPTIMEROBOT_SWITCH_TEST_ENTITY = "switch.test_monitor"
|
||||||
|
|
||||||
|
|
||||||
class MockApiResponseKey(str, Enum):
|
class MockApiResponseKey(str, Enum):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user