From 5b8dbd4aeb90ef9232a1b680a22b7e2746c51b9a Mon Sep 17 00:00:00 2001 From: vmanuel Date: Sun, 5 Jan 2020 22:48:00 +0100 Subject: [PATCH] Fixes #1 --- custom_components/google-fit/sensor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/google-fit/sensor.py b/custom_components/google-fit/sensor.py index fac6ede..fc17928 100644 --- a/custom_components/google-fit/sensor.py +++ b/custom_components/google-fit/sensor.py @@ -219,8 +219,9 @@ def state(self): @property def last_updated(self): """Returns date when it was last updated.""" - if isinstance(self._last_updated, int): - return utc_from_timestamp(self._last_updated) + if self._last_updated != 'unknown': + stamp = float(self._last_updated) + return utc_from_timestamp(int(stamp)) @property def name(self):