Use DeviceEntryType in Metoffice (#60252)
parent
d3c020325b
commit
0920e74aa2
|
@ -9,6 +9,7 @@ from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME
|
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
|
from homeassistant.helpers.device_registry import DeviceEntryType
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
|
|
||||||
|
@ -104,7 +105,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
def get_device_info(coordinates: str, name: str) -> DeviceInfo:
|
def get_device_info(coordinates: str, name: str) -> DeviceInfo:
|
||||||
"""Return device registry information."""
|
"""Return device registry information."""
|
||||||
return DeviceInfo(
|
return DeviceInfo(
|
||||||
entry_type="service",
|
entry_type=DeviceEntryType.SERVICE,
|
||||||
identifiers={(DOMAIN, coordinates)},
|
identifiers={(DOMAIN, coordinates)},
|
||||||
manufacturer="Met Office",
|
manufacturer="Met Office",
|
||||||
name=f"Met Office {name}",
|
name=f"Met Office {name}",
|
||||||
|
|
Loading…
Reference in New Issue