mirror of
https://github.com/home-assistant/core.git
synced 2025-04-28 03:07:50 +00:00
Add device to OpenUV (#100027)
This commit is contained in:
parent
140bc03fb1
commit
05635c913f
@ -18,6 +18,7 @@ from homeassistant.const import (
|
|||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers import aiohttp_client
|
from homeassistant.helpers import aiohttp_client
|
||||||
|
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
|
||||||
from homeassistant.helpers.entity import EntityDescription
|
from homeassistant.helpers.entity import EntityDescription
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
@ -126,6 +127,11 @@ class OpenUvEntity(CoordinatorEntity):
|
|||||||
f"{coordinator.latitude}_{coordinator.longitude}_{description.key}"
|
f"{coordinator.latitude}_{coordinator.longitude}_{description.key}"
|
||||||
)
|
)
|
||||||
self.entity_description = description
|
self.entity_description = description
|
||||||
|
self._attr_device_info = DeviceInfo(
|
||||||
|
identifiers={(DOMAIN, f"{coordinator.latitude}_{coordinator.longitude}")},
|
||||||
|
name="OpenUV",
|
||||||
|
entry_type=DeviceEntryType.SERVICE,
|
||||||
|
)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _handle_coordinator_update(self) -> None:
|
def _handle_coordinator_update(self) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user