Use last successful update instead of last update
This commit is contained in:
parent
c9746b957f
commit
3b6c4cfbb0
1 changed files with 1 additions and 1 deletions
2
main.py
2
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})"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue