Fix flipr timestamp sensor (#61203)

This commit is contained in:
Paulus Schoutsen 2021-12-07 22:48:04 -08:00 committed by GitHub
parent fa75c1f92f
commit 113a850c69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,6 @@
"""Sensor platform for the Flipr's pool_sensor.""" """Sensor platform for the Flipr's pool_sensor."""
from __future__ import annotations from __future__ import annotations
from datetime import datetime
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
from homeassistant.const import ( from homeassistant.const import (
DEVICE_CLASS_TEMPERATURE, DEVICE_CLASS_TEMPERATURE,
@ -60,7 +58,4 @@ class FliprSensor(FliprEntity, SensorEntity):
@property @property
def native_value(self): def native_value(self):
"""State of the sensor.""" """State of the sensor."""
state = self.coordinator.data[self.entity_description.key] return self.coordinator.data[self.entity_description.key]
if isinstance(state, datetime):
return state.isoformat()
return state