Skip to content

Convert more files to async/await syntax#14142

Merged
balloob merged 2 commits intohome-assistant:devfrom
OttoWinter:recorder-async-await
Apr 28, 2018
Merged

Convert more files to async/await syntax#14142
balloob merged 2 commits intohome-assistant:devfrom
OttoWinter:recorder-async-await

Conversation

@OttoWinter
Copy link
Copy Markdown
Member

Description:

This PR converts a few files to use the new and awesome async/await syntax in components I personally use.

As some of these components do not have good test coverage, I've been testing these changes for the last few days and I have not seen issues come up.

If it's a lot to review, I can also split it up into individual PRs.

Related issue (if applicable): #12614

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

@OttoWinter OttoWinter requested review from a team and andrey-git as code owners April 28, 2018 17:20
Comment thread tests/test_bootstrap.py
@asyncio.coroutine
@patch('homeassistant.bootstrap.async_enable_logging', Mock())
@patch('homeassistant.bootstrap.async_register_signal_handling', Mock())
@asyncio.coroutine
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This test was failing because of the order of these decorators. I'm not sure why this is though, as to me it makes more sense if it worked if the @asyncio.coroutine decorator is placed before the other decorators.

Anyway, this test passes now and I verified that the code block in here is actually executed.

@OttoWinter OttoWinter changed the title Move more files to async/await syntax Convert more files to async/await syntax Apr 28, 2018
@balloob
Copy link
Copy Markdown
Member

balloob commented Apr 28, 2018

ok to merge when you fix the linting issues.

@balloob balloob merged commit a4bf421 into home-assistant:dev Apr 28, 2018
@balloob balloob mentioned this pull request May 11, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Sep 5, 2018
@OttoWinter OttoWinter deleted the recorder-async-await branch September 29, 2018 10:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants