-
-
Notifications
You must be signed in to change notification settings - Fork 28.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
Revert "Add dynamic generation of device triggers from keypad buttons #80797" #82605
Conversation
Hey there @swails, @danaues, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
@danaues Sorry about doing a revert. Let me know if you have see another way. |
Is there an async call that we can await , so it happens right when the integration is set up?
|
Have you tested with the revert to confirm that it fixes the issue? I don't see anything that should make this slower that the original. Not waiting on any extra calls from the bridge, just looping through some dicts. |
That would work unless the integration fails to setup in which case it would deadlock setting up automations. We could add a timeout but that gets us back to the same failure state where the integration isn't setup yet. |
Yes. I added an explicit test as well to make sure it can still attach triggers if the integration is slow to setup, failed, or retrying by unloading the integration and making sure the triggers still attach
The original didn't require the integration to be setup to attach the triggers which is the core issue here. We can't be sure it will be completed setup at attach time |
I was digging into the device triggers to see if we can do some type of late attach but I haven't finished going through it yet because of the holiday |
The validation can handle the config entry not being loaded yet
But attaching the trigger can't because thats the point where the automation is being setup
|
"parent_keypad": "9", | ||
}, | ||
"1372": { | ||
"button_name": "Kitchen " "Pendants", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a problem since if you rename the button the trigger breaks
We do late attach in the new PluggableActions |
This one is getting replaced with #82714 |
Proposed change
I tried to figure out a way to rework this but it since #80797 requires the integration to be setup to attach the trigger its not going to work if the integration isn't setup in time or is in a failed/retry state.
I think we are going to have to rework that design to rely only what is in the device registry when attaching triggers.
I hate to do a revert of #80797 but since it causes pico remotes to no longer function if the bridge isn't available right away at startup or ends up in retry at startup as reported in #82495 & #81999 I don't think we have another option.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: