-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fix pin reuse error with pin expanders #5973
Conversation
Since the ID will be unique for each instance of a component, shouldn't it be sufficient to just use the changes around line 68 to use the correct value for the first part of the key, rather than adding an extra dimension to the key? That section of code (lines 68 and 69) did bother me at the time since it appeared to work, but I was not 100% clear on why. |
Or is it possible that a single component can have multiple registered pin schemas? In which case the extra key dimension is needed. |
I tried that, but the key is pulled out later on line 107 to get the final_validation function, so the non-id key is needed |
Ah ok. Looks Good Enough to me. I'm sure it will get revisited over time :-) |
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
Confirmed this fixed the issue for me in dev |
What does this implement/fix?
If the same pin number was used but from two different i/o expanders in the same platform, the error was given. This changes to use the id of the expander as part of the key
Types of changes
Related issue or feature (if applicable): fixes
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#
Test Environment
Example entry for
config.yaml
:# Example config.yaml
Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: