mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Add DeviceInfo to trafikverket_weatherstation (#64083)
* Add DeviceInfo to trafikverket_weatherstation * Correct DeviceInfo
This commit is contained in:
parent
c1692a324b
commit
55143e240b
@ -31,6 +31,8 @@ from homeassistant.const import (
|
|||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
from homeassistant.helpers.device_registry import DeviceEntryType
|
||||||
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
@ -218,6 +220,14 @@ class TrafikverketWeatherStation(SensorEntity):
|
|||||||
self._attr_unique_id = f"{entry_id}_{description.key}"
|
self._attr_unique_id = f"{entry_id}_{description.key}"
|
||||||
self._station = sensor_station
|
self._station = sensor_station
|
||||||
self._weather_api = weather_api
|
self._weather_api = weather_api
|
||||||
|
self._attr_device_info = DeviceInfo(
|
||||||
|
entry_type=DeviceEntryType.SERVICE,
|
||||||
|
identifiers={(DOMAIN, entry_id)},
|
||||||
|
manufacturer="Trafikverket",
|
||||||
|
model="v1.2",
|
||||||
|
name=sensor_station,
|
||||||
|
configuration_url="https://api.trafikinfo.trafikverket.se/",
|
||||||
|
)
|
||||||
self._weather: WeatherStationInfo | None = None
|
self._weather: WeatherStationInfo | None = None
|
||||||
|
|
||||||
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user