Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions custom_components/zaptec/zaptec/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,16 @@ async def poll_firmware_info(self) -> None:
charger = self.zaptec.get(fm["ChargerId"])
if charger is None:
continue
if (
fm.get("CurrentVersion") is None
or fm.get("AvailableVersion") is None
or fm.get("IsUpToDate") is None
):
# If the charger is already added to the Zaptec platform but not yet
# initialized, these fields are not available.
_LOGGER.warning("Missing firmware info for charger %s", charger.qual_id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a warning that will be pushed to be visible to the users. Are we certain the error message is explanatory enough without the context? Can we foresee a issue report from users on this message? -- Perhaps something like "Missing firmware info from charger %s because the charger haven't been initialized yet. Safe to ignore" or something alike.

continue

charger.set_attributes(
{
"firmware_current_version": fm["CurrentVersion"],
Expand Down
Loading