Skip attribute initialisation when firmware info is missing#324
Skip attribute initialisation when firmware info is missing#324sveinse merged 4 commits intocustom-components:masterfrom
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.
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.
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.
There was a problem hiding this comment.
@feliciaan Please respond, so that we can include this in the upcoming 0.8.4 release.
There was a problem hiding this comment.
Changed it, I think it's ready to merge.
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.