Skip to content
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

Add additional unique ID suffix to v2 quirks #303

Open
TheJulianJES opened this issue Nov 25, 2024 · 0 comments
Open

Add additional unique ID suffix to v2 quirks #303

TheJulianJES opened this issue Nov 25, 2024 · 0 comments
Labels
enhancement New feature or request priority: medium This should be addressed or looked at soon quirks Quirks related

Comments

@TheJulianJES
Copy link
Contributor

We should provide an optional kwarg for a unique ID "suffix suffix" to this:

if has_attribute_name:
self._unique_id_suffix = entity_metadata.attribute_name
elif has_command_name:
self._unique_id_suffix = entity_metadata.command_name

Currently, v2 quirks can only add one entity (per platform) per attribute id. Otherwise, they silently fail to create at runtime due to duplicate IDs. This is an issue with buttons (writing different values) or (binary) sensors (parsing values differently).

We should validate quirks v2 metadata (in zha-quirks, zigpy, or zha?) to make sure there's an explicit warning about this.
If this happens, the conflicting quirk v2 entities should have a uid_suffix kwarg added. This would be an additional suffix to the attribute UID suffix already in ZHA.

@TheJulianJES TheJulianJES added enhancement New feature or request priority: medium This should be addressed or looked at soon quirks Quirks related labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: medium This should be addressed or looked at soon quirks Quirks related
Projects
None yet
Development

No branches or pull requests

1 participant