1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Removing asyncio.coroutine syntax from HASS core (#12509)

* changed asyncio.coroutine syntax to new async def/await

* removed py34 from tox environment

* reverted some changes within entity.py

* -

* reverted changes within bootstrap.py

* reverted changes within discovery.py

* switched decorators

* Reverted change within aiohttp_client.py

* reverted change within logging.py

* switched decorators

* Await lock properly

* removed asyncio.coroutine from test
This commit is contained in:
Julius Mittenzwei
2018-02-25 12:38:46 +01:00
committed by Paulus Schoutsen
parent eacfbc048a
commit 16cb7388ee
20 changed files with 148 additions and 202 deletions

View File

@@ -1,5 +1,5 @@
"""Script to ensure a configuration file exists."""
import asyncio
import argparse
import logging
import os
@@ -46,8 +46,7 @@ C_HEAD = 'bold'
ERROR_STR = 'General Errors'
@asyncio.coroutine
def mock_coro(*args):
async def mock_coro(*args):
"""Coroutine that returns None."""
return None
@@ -181,8 +180,7 @@ def check(config_path):
# pylint: disable=unused-variable
def mock_get(comp_name):
"""Mock hass.loader.get_component to replace setup & setup_platform."""
@asyncio.coroutine
def mock_async_setup(*args):
async def mock_async_setup(*args):
"""Mock setup, only record the component name & config."""
assert comp_name not in res['components'], \
"Components should contain a list of platforms"