Migrate Uptimerobot to has entity name (#96770)
This commit is contained in:
parent
13fd5a59e3
commit
44803e1177
5 changed files with 3 additions and 4 deletions
|
@ -27,7 +27,6 @@ async def async_setup_entry(
|
|||
coordinator,
|
||||
BinarySensorEntityDescription(
|
||||
key=str(monitor.id),
|
||||
name=monitor.friendly_name,
|
||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||
),
|
||||
monitor=monitor,
|
||||
|
|
|
@ -15,6 +15,8 @@ class UptimeRobotEntity(CoordinatorEntity[UptimeRobotDataUpdateCoordinator]):
|
|||
"""Base UptimeRobot entity."""
|
||||
|
||||
_attr_attribution = ATTRIBUTION
|
||||
_attr_has_entity_name = True
|
||||
_attr_name = None
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
|
|
@ -46,7 +46,6 @@ async def async_setup_entry(
|
|||
coordinator,
|
||||
SensorEntityDescription(
|
||||
key=str(monitor.id),
|
||||
name=monitor.friendly_name,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
options=["down", "not_checked_yet", "pause", "seems_down", "up"],
|
||||
|
|
|
@ -29,7 +29,6 @@ async def async_setup_entry(
|
|||
coordinator,
|
||||
SwitchEntityDescription(
|
||||
key=str(monitor.id),
|
||||
name=f"{monitor.friendly_name} Active",
|
||||
device_class=SwitchDeviceClass.SWITCH,
|
||||
),
|
||||
monitor=monitor,
|
||||
|
|
|
@ -66,7 +66,7 @@ STATE_UP = "up"
|
|||
|
||||
UPTIMEROBOT_BINARY_SENSOR_TEST_ENTITY = "binary_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):
|
||||
|
|
Loading…
Add table
Reference in a new issue