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

Fix exposure of date, time and datetime object when threaded=True #925

Merged
merged 3 commits into from
Apr 20, 2022

Conversation

marvin-w
Copy link
Member

@marvin-w marvin-w commented Apr 20, 2022

Description

I assume that the second event loop in the connection thread was executed before the
tasks in the task registry were registered. And probably for some reason the currently running event loop
was the one from the connection thread. Since the event loop had already been started with run_forever() no new
tasks would be scheduled.

Fixes home-assistant/core#69328

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • The documentation has been adjusted accordingly
  • The changes generate no new warnings
  • Tests have been added that prove the fix is effective or that the feature works
  • The changes are documented in the changelog
  • The Homeassistant plugin has been adjusted in case of new config options

I assume that the second event loop in the connection thread was executed before the
tasks in the task registry were registered. And probably for some reason the currently running event loop
was the one from the connection thread. Since the event loop had already been started with run_forever() no new
tasks would be scheduled.
@marvin-w marvin-w requested a review from farmio April 20, 2022 18:13
@codecov
Copy link

codecov bot commented Apr 20, 2022

Codecov Report

Merging #925 (447e268) into main (28429ee) will decrease coverage by 0.00%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #925      +/-   ##
==========================================
- Coverage   95.56%   95.55%   -0.01%     
==========================================
  Files         130      130              
  Lines        7803     7810       +7     
==========================================
+ Hits         7457     7463       +6     
- Misses        346      347       +1     
Impacted Files Coverage Δ
xknx/core/task_registry.py 98.43% <85.71%> (-1.57%) ⬇️
xknx/xknx.py 89.00% <100.00%> (+0.11%) ⬆️

@marvin-w marvin-w merged commit b03d9ef into XKNX:main Apr 20, 2022
@marvin-w marvin-w deleted the fix/datetime_exposure branch April 20, 2022 20:22
farmio added a commit that referenced this pull request Apr 30, 2022
marvin-w pushed a commit that referenced this pull request May 1, 2022
* revert #925 - loop handling in task_registry

* TaskRegistry takes functions returning coroutines instead of coroutines directly

* ignore lint error in test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

knx tunneling connection loss - time/date no longer exposed - reconnect should not trigger automation
1 participant