-
Notifications
You must be signed in to change notification settings - Fork 23
Skip attribute initialisation when firmware info is missing #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Add warning for missing firmware info in charger attributes, prevents the integration from crashing while starting. This only happens for chargers that are added to the Zaptec portal, but not configured or correctly added.
charger = self.zaptec.get(fm["ChargerId"]) | ||
if charger is None: | ||
continue | ||
if fm.get("CurrentVersion") is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe do the check for all 3 keys just to be sure there's no obscure case where one key is defined while the others aren't?
@feliciaan Is this issue critical enough to delay the release of 0.8.3 ? Should we wait for this one? |
I think it's complete, so it can be merged, but I also think it's not a high priority issue, so it can be put in the next release. |
): | ||
# 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) |
There was a problem hiding this comment.
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.
Skip attributes and add warning for missing firmware info in charger attributes, prevents the integration from crashing while starting, if these attributes are not available.
This only happens for chargers that are added to the Zaptec portal, but not configured or correctly added.