Skip to content

Commit

Permalink
Fixes update sensor after startup, fixes #174
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaae committed Nov 14, 2024
1 parent 025045a commit ed432b9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion custom_components/truenas/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,20 @@ def get_updatecheck(self) -> None:
{
"name": "update_version",
"source": "version",
"default": self.ds["system_info"]["version"],
"default": "unknown",
},
],
)

if not self.api.connected():
return

if (
self.ds["system_info"]["update_version"] == "unknown"
and self.ds["system_info"]["version"]
):
self.ds["system_info"]["update_version"] = self.ds["system_info"]["version"]

self.ds["system_info"]["update_available"] = (
self.ds["system_info"]["update_status"] == "AVAILABLE"
)
Expand Down

0 comments on commit ed432b9

Please sign in to comment.