Migrate Uptimerobot to has entity name (#96770)

This commit is contained in:
Joost Lekkerkerker 2023-07-22 16:55:05 +02:00 committed by GitHub
parent 13fd5a59e3
commit 44803e1177
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 4 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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"],

View file

@ -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,

View file

@ -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):