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

Select correct coordinator for execute_command service #797

Closed

Conversation

vlebourl
Copy link
Collaborator

@vlebourl vlebourl commented Apr 7, 2022

In case several hubs are registered, the service was called on the latest coordinator registered, which could thus be one not corresponding to the entity passed as argument. This fix allows to retrieve the coordinator attached to the given entity.

can relate to #167

In case several hubs are registered, the service was called on the latest coordinator registered, which could thus be one not corresponding to the entity passed as argument. This fix allows to retrieve the coordinator attached to the given entity.
@github-actions github-actions bot added the bug Something isn't working label Apr 7, 2022
@vlebourl vlebourl changed the title Select coordinator for execut_command service Select correct coordinator for execute_command service Apr 7, 2022
@vlebourl
Copy link
Collaborator Author

can we merge ?

e
for e in hass.data["entity_components"][registry_entry.domain].entities
if e.unique_id == registry_entry.unique_id
][0]
Copy link
Owner

Choose a reason for hiding this comment

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

You could perhaps also use next() here, instead of [0].

Copy link
Owner

@iMicknl iMicknl left a comment

Choose a reason for hiding this comment

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

Nice fix!

@iMicknl iMicknl closed this Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants