From 3adb9e4143f827a934d3ade5d6f3eea23f8d7da3 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 18 Nov 2021 20:03:04 +0100 Subject: [PATCH] Use native datetime value in Tasmota sensors (#59915) --- homeassistant/components/tasmota/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/tasmota/sensor.py b/homeassistant/components/tasmota/sensor.py index 348ff741c9b..678d3eaf4fa 100644 --- a/homeassistant/components/tasmota/sensor.py +++ b/homeassistant/components/tasmota/sensor.py @@ -259,10 +259,10 @@ class TasmotaSensor(TasmotaAvailability, TasmotaDiscoveryUpdate, SensorEntity): return class_or_icon.get(ICON) @property - def native_value(self) -> str | None: + def native_value(self) -> datetime | str | None: """Return the state of the entity.""" if self._state_timestamp and self.device_class == DEVICE_CLASS_TIMESTAMP: - return self._state_timestamp.isoformat() + return self._state_timestamp return self._state @property