Use DeviceInfo in twentemilieu (#58608)

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/58628/head
epenet 2021-10-28 18:23:41 +02:00 committed by GitHub
parent 2dcb429c95
commit d065ddc5c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 12 deletions

View File

@ -12,13 +12,7 @@ from twentemilieu import (
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_IDENTIFIERS,
ATTR_MANUFACTURER,
ATTR_NAME,
CONF_ID,
DEVICE_CLASS_DATE,
)
from homeassistant.const import CONF_ID, DEVICE_CLASS_DATE
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -153,8 +147,8 @@ class TwenteMilieuSensor(SensorEntity):
@property
def device_info(self) -> DeviceInfo:
"""Return device information about Twente Milieu."""
return {
ATTR_IDENTIFIERS: {(DOMAIN, self._unique_id)},
ATTR_NAME: "Twente Milieu",
ATTR_MANUFACTURER: "Twente Milieu",
}
return DeviceInfo(
identifiers={(DOMAIN, self._unique_id)},
manufacturer="Twente Milieu",
name="Twente Milieu",
)