Skip to content

Comments

Use state value for authorization required for more frequent updates#230

Merged
sveinse merged 2 commits intocustom-components:masterfrom
steinmn:fix-swap-authorization-required-entity-to-use-state
Jul 23, 2025
Merged

Use state value for authorization required for more frequent updates#230
sveinse merged 2 commits intocustom-components:masterfrom
steinmn:fix-swap-authorization-required-entity-to-use-state

Conversation

@steinmn
Copy link
Contributor

@steinmn steinmn commented Jul 23, 2025

Use authentication_required instead of is_authorization_required since that is part of the state update.

Fixes (part of) #219

Use `authentication_required` instead of `is_authorization_required` since that is part of the state update.

Fixes (part of) custom-components#219
@sveinse sveinse added this to the v0.8 milestone Jul 23, 2025
Comment on lines 286 to 293
elif entity.unique_id.endswith("_is_authorization_required"):
# There is an entity using authorization_required as a translation key in
# both the installation and the charger device. We only want to replace the
# entity associated with the charger, so we use the end of the unique_id
# to find the correct entity that will be readded later (the installation
# entity ends with '_is_required_authentication').
_LOGGER.warning("Removing deprecated entity: %s", entity_id)
entity_registry.async_remove(entity_id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good. I wonder thou: Should we add to the comment of this one and the "operating_mode" that this added for the upgrade from "v0.7 -> v0.8"? This is useful information to have when this is reviewed in the future and the memory of why this code exists is forgotten.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While git-blame does help with this, that is a VERY good point, will add.

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.

LGTM. Thank you.

@sveinse sveinse merged commit 5cd6db5 into custom-components:master Jul 23, 2025
1 check passed
@steinmn steinmn deleted the fix-swap-authorization-required-entity-to-use-state branch July 23, 2025 20:48
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.

2 participants