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

Tado: Initiate websession inside event loop #24331

Merged
merged 1 commit into from
Jun 6, 2019
Merged

Conversation

balloob
Copy link
Member

@balloob balloob commented Jun 6, 2019

Description:

Fixes:

Error setting up platform legacy
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/device_tracker/setup.py", line 69, in async_setup_legacy
    self.platform.get_scanner, hass, {DOMAIN: self.config})
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/tado/device_tracker.py", line 33, in get_scanner
    scanner = TadoDeviceScanner(hass, config[DOMAIN])
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/tado/device_tracker.py", line 64, in __init__
    hass, cookie_jar=aiohttp.CookieJar(unsafe=True))
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/cookiejar.py", line 55, in __init__
    super().__init__(loop=loop)
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/abc.py", line 146, in __init__
    self._loop = get_running_loop(loop)
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/helpers.py", line 267, in get_running_loop
    loop = asyncio.get_event_loop()
  File "/usr/lib/python3.6/asyncio/events.py", line 694, in get_event_loop
    return get_event_loop_policy().get_event_loop()
  File "/usr/lib/python3.6/asyncio/events.py", line 602, in get_event_loop
    % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'SyncWorker_18'.
Error setting up platform legacy
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/device_tracker/setup.py", line 69, in async_setup_legacy
    self.platform.get_scanner, hass, {DOMAIN: self.config})
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/tado/device_tracker.py", line 33, in get_scanner
    scanner = TadoDeviceScanner(hass, config[DOMAIN])
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/tado/device_tracker.py", line 64, in __init__
    hass, cookie_jar=aiohttp.CookieJar(unsafe=True))
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/cookiejar.py", line 55, in __init__
    super().__init__(loop=loop)
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/abc.py", line 146, in __init__
    self._loop = get_running_loop(loop)
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/helpers.py", line 267, in get_running_loop
    loop = asyncio.get_event_loop()
  File "/usr/lib/python3.6/asyncio/events.py", line 694, in get_event_loop
    return get_event_loop_policy().get_event_loop()
  File "/usr/lib/python3.6/asyncio/events.py", line 602, in get_event_loop
    % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'SyncWorker_18'.

Related issue (if applicable): fixes https://community.home-assistant.io/t/0-94-smarthab-watson-tts-azure-event-hub/120228/15?u=balloob

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@balloob balloob added this to the 0.94.1 milestone Jun 6, 2019
@pvizeli pvizeli merged commit d261c6c into dev Jun 6, 2019
@delete-merged-branch delete-merged-branch bot deleted the tado-init-websession-async branch June 6, 2019 10:07
balloob added a commit that referenced this pull request Jun 8, 2019
@balloob balloob mentioned this pull request Jun 8, 2019
alandtse pushed a commit to alandtse/home-assistant that referenced this pull request Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants