Use DeviceEntryType in non-typechecked code too (#58646)

This commit is contained in:
Ville Skyttä 2021-11-23 11:04:33 +02:00 committed by GitHub
parent ca20fc857f
commit 39691faccc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 50 additions and 31 deletions

View file

@ -12,6 +12,7 @@ from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import debounce
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.device_registry import DeviceEntryType
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.event import async_track_point_in_utc_time
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
@ -172,7 +173,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
def device_info(latitude, longitude) -> DeviceInfo:
"""Return device registry information."""
return DeviceInfo(
entry_type="service",
entry_type=DeviceEntryType.SERVICE,
identifiers={(DOMAIN, base_unique_id(latitude, longitude))},
manufacturer="National Weather Service",
name=f"NWS: {latitude}, {longitude}",