From 3b6c4cfbb0db06172a594ca86d129cad86095ce0 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Wed, 29 Jul 2020 09:42:29 +0200 Subject: [PATCH] Use last successful update instead of last update --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 8af0944..55c23af 100644 --- a/main.py +++ b/main.py @@ -53,7 +53,7 @@ def main(): def format_temp(data: dict) -> str: name = data["attributes"]["friendly_name"].lower().replace("temperature", "").strip() - diff = pendulum.parse(data["last_updated"]).diff_for_humans(locale="fr") + diff = pendulum.parse(data["attributes"]["last_successful_update"]).diff_for_humans(locale="fr") return f"{name} : {data['state']}{data['attributes']['unit_of_measurement']} ({diff})"