mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Use native date value in Twente Milieu sensors (#59897)
This commit is contained in:
parent
4a83ee5dab
commit
5e07bc38c1
@ -12,7 +12,6 @@ from homeassistant.const import CONF_ID, DEVICE_CLASS_DATE
|
|||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
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 StateType
|
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import (
|
||||||
CoordinatorEntity,
|
CoordinatorEntity,
|
||||||
DataUpdateCoordinator,
|
DataUpdateCoordinator,
|
||||||
@ -104,8 +103,6 @@ class TwenteMilieuSensor(CoordinatorEntity, SensorEntity):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def native_value(self) -> StateType:
|
def native_value(self) -> date | None:
|
||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
if pickup := self.coordinator.data.get(self.entity_description.waste_type):
|
return self.coordinator.data.get(self.entity_description.waste_type)
|
||||||
return pickup.isoformat()
|
|
||||||
return None
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user