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

[Improvement] - Changing the loading order of built-in and custom quirks #299

Open
ckm2k1 opened this issue Nov 20, 2024 · 0 comments
Open
Labels
enhancement New feature or request priority: medium This should be addressed or looked at soon

Comments

@ckm2k1
Copy link
Contributor

ckm2k1 commented Nov 20, 2024

Hi!

I noticed an issue while trying to debug the problem this PR fixes: zigpy/zha-device-handlers#3504

To test my fix, I added a modified copy of the Sinope quirk into the custom quirks directory (config/zhaquirks/sinope) in my live HA instance.
Although ZHA loads the modified quirk just fine, since the fix itself happens at definition time, my modifications are loaded too late in the process to fix the call to async_attach_trigger() in /zha/core/homeassistant/components/zha/device_trigger.py.

Instead, I had to ssh into HA OS as root and modify the zhaquirks code manually in /usr/local/lib/python3.12/site-packages/zhaquirks/sinope/__init__.py. This worked, but is pretty tedious if you're trying to iterate and test your changes.

I don't know if it's possible, but it would be nice if the loading order was changed such that if a custom quirk is present and it overrides an existing quirk, it would be loaded instead of the builtin one, and not after it.

cc @TheJulianJES

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
Projects
None yet
Development

No branches or pull requests

2 participants