-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Use asyncio in XiaomiAqara instead of threading #74979
Conversation
Hey there @Danielhiversen, @syssi, mind taking a look at this pull request as it has been labeled with an integration ( |
Test failure is unrelated |
@Danielhiversen would you mind revieuwing and approving this PR? |
@frenck do you have time to review/merge this? |
@MartinHjelmare I prossed all your feedback, thanks a lot, I keep learing. Do you have any more feedback or can this be merged? |
@@ -293,7 +293,7 @@ def parse_data(self, data, raw_data): | |||
) | |||
|
|||
if self.entity_id is not None: | |||
self._hass.bus.fire( | |||
self._hass.bus.async_fire( |
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.
Side note for the future: All of these events should be moved out of the binary sensor platform. Entities shouldn't fire custom events.
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.
I know (from the Xiaomi Miio PR) but that is out of scope for this PR.
The rest of that part of the code is untouched, I only use the appropriate async_fire instead of just fire.
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@MartinHjelmare can you merge this? |
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.
Thanks!
Breaking change
Proposed change
Use async instead of a infinite while loop in a thread for listening to multicast messages in the Xiaomi Aqara integration.
Bump PyXiaomiGateway to 0.14.1:
Danielhiversen/PyXiaomiGateway@0.13.4...0.14.1
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
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: