Add DeviceInfo to trafikverket_weatherstation (#64083)
* Add DeviceInfo to trafikverket_weatherstation * Correct DeviceInfo
This commit is contained in:
parent
c1692a324b
commit
55143e240b
1 changed files with 10 additions and 0 deletions
|
@ -31,6 +31,8 @@ from homeassistant.const import (
|
|||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
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.typing import ConfigType, DiscoveryInfoType
|
||||
from homeassistant.util import Throttle
|
||||
|
@ -218,6 +220,14 @@ class TrafikverketWeatherStation(SensorEntity):
|
|||
self._attr_unique_id = f"{entry_id}_{description.key}"
|
||||
self._station = sensor_station
|
||||
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
|
||||
|
||||
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||
|
|
Loading…
Add table
Reference in a new issue