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

@ -50,8 +50,7 @@ def benchmark(func):
@benchmark
@asyncio.coroutine
def async_million_events(hass):
async def async_million_events(hass):
"""Run a million events."""
count = 0
event_name = 'benchmark_event'
@ -73,15 +72,14 @@ def async_million_events(hass):
start = timer()
yield from event.wait()
await event.wait()
return timer() - start
@benchmark
@asyncio.coroutine
# pylint: disable=invalid-name
def async_million_time_changed_helper(hass):
async def async_million_time_changed_helper(hass):
"""Run a million events through time changed helper."""
count = 0
event = asyncio.Event(loop=hass.loop)
@ -105,15 +103,14 @@ def async_million_time_changed_helper(hass):
start = timer()
yield from event.wait()
await event.wait()
return timer() - start
@benchmark
@asyncio.coroutine
# pylint: disable=invalid-name
def async_million_state_changed_helper(hass):
async def async_million_state_changed_helper(hass):
"""Run a million events through state changed helper."""
count = 0
entity_id = 'light.kitchen'
@ -141,7 +138,7 @@ def async_million_state_changed_helper(hass):
start = timer()
yield from event.wait()
await event.wait()
return timer() - start