Use native datetime value in Uptime sensors (#59916)

This commit is contained in:
Franck Nijhof 2021-11-18 20:03:30 +01:00 committed by GitHub
parent 4e4f6ffa07
commit fc29611935
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,4 +50,4 @@ class UptimeSensor(SensorEntity):
self._attr_name: str = name self._attr_name: str = name
self._attr_device_class: str = DEVICE_CLASS_TIMESTAMP self._attr_device_class: str = DEVICE_CLASS_TIMESTAMP
self._attr_should_poll: bool = False self._attr_should_poll: bool = False
self._attr_native_value: str = dt_util.now().isoformat() self._attr_native_value = dt_util.now()