Skip to content

Comments

Fix TypeError-crash for users without access to Hierarchy-endpoint#321

Merged
sveinse merged 2 commits intocustom-components:masterfrom
steinmn:handle-no-content-hierarchy
Sep 20, 2025
Merged

Fix TypeError-crash for users without access to Hierarchy-endpoint#321
sveinse merged 2 commits intocustom-components:masterfrom
steinmn:handle-no-content-hierarchy

Conversation

@steinmn
Copy link
Contributor

@steinmn steinmn commented Sep 20, 2025

Handle a 204(no content)-response the same way we have handled a 403-response previously.

Fixes #320

Handle a 204(no content)-response the same way we have handled a 403-response previously.
@steinmn
Copy link
Contributor Author

steinmn commented Sep 20, 2025

@sveinse I think this means we need to consider a 0.8.3-beta soon, though I would like to hear from Zaptec if there are any more recent/upcoming API changes we need to handle as well.

Copy link
Collaborator

@sveinse sveinse left a comment

Choose a reason for hiding this comment

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

I'd like to hear from Zaptec too before pushing a new release.

PR approved.

Comment on lines 240 to 246
if not hierarchy:
_LOGGER.warning(
("No hierarchy returned for installation %s. The user might not have access"),
self.qual_id,
)
self.chargers = []
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

On second thought. Please, add a comment with date on it saying that Zaptec seems to return 204 empty data when the user doesn't have access instead of returning an error.

@sveinse sveinse merged commit 8739fab into custom-components:master Sep 20, 2025
6 checks passed
@sveinse sveinse added this to the v0.8.3 milestone Sep 21, 2025
@steinmn steinmn deleted the handle-no-content-hierarchy branch September 22, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration stopped working - circuit must be int or slices, not str

2 participants