Use DeviceInfo in waze-travel-time (#58637)

This commit is contained in:
epenet 2021-10-28 23:58:53 +02:00 committed by GitHub
parent 107bd11a31
commit 95f7b0c026
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,7 @@ from homeassistant.const import (
) )
from homeassistant.core import Config, CoreState, HomeAssistant from homeassistant.core import Config, CoreState, HomeAssistant
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
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 DiscoveryInfoType from homeassistant.helpers.typing import DiscoveryInfoType
@ -163,11 +164,11 @@ class WazeTravelTime(SensorEntity):
"""Representation of a Waze travel time sensor.""" """Representation of a Waze travel time sensor."""
_attr_native_unit_of_measurement = TIME_MINUTES _attr_native_unit_of_measurement = TIME_MINUTES
_attr_device_info = { _attr_device_info = DeviceInfo(
"name": "Waze", entry_type="service",
"identifiers": {(DOMAIN, DOMAIN)}, name="Waze",
"entry_type": "service", identifiers={(DOMAIN, DOMAIN)},
} )
def __init__(self, unique_id, name, origin, destination, waze_data): def __init__(self, unique_id, name, origin, destination, waze_data):
"""Initialize the Waze travel time sensor.""" """Initialize the Waze travel time sensor."""