mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Migrate attribution attribute for UptimeRobot (#57508)
This commit is contained in:
parent
813e27a46a
commit
1a68784852
@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from pyuptimerobot import UptimeRobotMonitor
|
from pyuptimerobot import UptimeRobotMonitor
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ATTRIBUTION
|
|
||||||
from homeassistant.helpers.entity import EntityDescription
|
from homeassistant.helpers.entity import EntityDescription
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import (
|
||||||
CoordinatorEntity,
|
CoordinatorEntity,
|
||||||
@ -16,6 +15,8 @@ from .const import ATTR_TARGET, ATTRIBUTION, DOMAIN
|
|||||||
class UptimeRobotEntity(CoordinatorEntity):
|
class UptimeRobotEntity(CoordinatorEntity):
|
||||||
"""Base UptimeRobot entity."""
|
"""Base UptimeRobot entity."""
|
||||||
|
|
||||||
|
_attr_attribution = ATTRIBUTION
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
coordinator: DataUpdateCoordinator,
|
coordinator: DataUpdateCoordinator,
|
||||||
@ -34,7 +35,6 @@ class UptimeRobotEntity(CoordinatorEntity):
|
|||||||
"model": self.monitor.type.name,
|
"model": self.monitor.type.name,
|
||||||
}
|
}
|
||||||
self._attr_extra_state_attributes = {
|
self._attr_extra_state_attributes = {
|
||||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
|
||||||
ATTR_TARGET: self.monitor.url,
|
ATTR_TARGET: self.monitor.url,
|
||||||
}
|
}
|
||||||
self._attr_unique_id = str(self.monitor.id)
|
self._attr_unique_id = str(self.monitor.id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user