Add date device_class to Twente Milieu sensors (#56579)

This commit is contained in:
Franck Nijhof
2021-09-23 20:09:00 +02:00
committed by GitHub
parent fed5f5e3b9
commit 750a1b84ad

View File

@@ -12,7 +12,13 @@ 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
from homeassistant.const import (
ATTR_IDENTIFIERS,
ATTR_MANUFACTURER,
ATTR_NAME,
CONF_ID,
DEVICE_CLASS_DATE,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@@ -74,6 +80,8 @@ async def async_setup_entry(
class TwenteMilieuSensor(SensorEntity):
"""Defines a Twente Milieu sensor."""
_attr_device_class = DEVICE_CLASS_DATE
def __init__(
self,
twentemilieu: TwenteMilieu,