Use native date value in Twente Milieu sensors (#59897)

pull/59907/head
Franck Nijhof 2021-11-18 15:32:50 +01:00 committed by GitHub
parent 4a83ee5dab
commit 5e07bc38c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -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)