Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Commit

Permalink
Fix last app start timestamp (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgarwood authored May 15, 2022
1 parent 6b5ef4f commit 0cbef91
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions custom_components/fullykiosk/sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Fully Kiosk Browser sensor."""
from dateutil import parser
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
Expand Down Expand Up @@ -110,6 +111,10 @@ def state(self):
if self._sensor in STORAGE_SENSORS:
return round(self.coordinator.data[self._sensor] * 0.000001, 1)

if self._sensor == "lastAppStart":
time = parser.parse(self.coordinator.data[self._sensor])
return time

return self.coordinator.data.get(self._sensor)

async def async_added_to_hass(self):
Expand Down

0 comments on commit 0cbef91

Please sign in to comment.