From 5e07bc38c1385e3dc8b02ff1da85831a73a1d287 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 18 Nov 2021 15:32:50 +0100 Subject: [PATCH] Use native date value in Twente Milieu sensors (#59897) --- homeassistant/components/twentemilieu/sensor.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/twentemilieu/sensor.py b/homeassistant/components/twentemilieu/sensor.py index bb3176e5834..259f3c4e969 100644 --- a/homeassistant/components/twentemilieu/sensor.py +++ b/homeassistant/components/twentemilieu/sensor.py @@ -12,7 +12,6 @@ from homeassistant.const import CONF_ID, DEVICE_CLASS_DATE from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback -from homeassistant.helpers.typing import StateType from homeassistant.helpers.update_coordinator import ( CoordinatorEntity, DataUpdateCoordinator, @@ -104,8 +103,6 @@ class TwenteMilieuSensor(CoordinatorEntity, SensorEntity): ) @property - def native_value(self) -> StateType: + def native_value(self) -> date | None: """Return the state of the sensor.""" - if pickup := self.coordinator.data.get(self.entity_description.waste_type): - return pickup.isoformat() - return None + return self.coordinator.data.get(self.entity_description.waste_type)