Change device entry type to an StrEnum (#59940)

Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Ville Skyttä 2021-11-22 19:14:15 +02:00 committed by GitHub
parent 4a5238efa5
commit 053c456199
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 167 additions and 71 deletions

View file

@ -13,6 +13,7 @@ from homeassistant.components.binary_sensor import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceEntryType
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import (
@ -20,7 +21,7 @@ from homeassistant.helpers.update_coordinator import (
DataUpdateCoordinator,
)
from .const import DOMAIN, ENTRY_TYPE_SERVICE
from .const import DOMAIN
@dataclass
@ -87,7 +88,7 @@ class RDWBinarySensorEntity(CoordinatorEntity, BinarySensorEntity):
self._attr_unique_id = f"{coordinator.data.license_plate}_{description.key}"
self._attr_device_info = DeviceInfo(
entry_type=ENTRY_TYPE_SERVICE,
entry_type=DeviceEntryType.SERVICE,
identifiers={(DOMAIN, coordinator.data.license_plate)},
manufacturer=coordinator.data.brand,
name=f"{coordinator.data.brand}: {coordinator.data.license_plate}",