Use proper signals (#18613)

* Emulated Hue not use deprecated handler

* Remove no longer needed workaround

* Add middleware directly

* Dont always load the ban config file

* Update homeassistant/components/http/ban.py

Co-Authored-By: balloob <paulus@home-assistant.io>

* Update __init__.py
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2018-11-21 20:55:21 +01:00
1 parent 5b3e9399a9
commit 1341ecd2eb
7 files changed
+43 -45

No files matched your search

+1 -6
View File
@@ -302,12 +302,6 @@ class HomeAssistantHTTP:
async def start(self):
"""Start the aiohttp server."""
# We misunderstood the startup signal. You're not allowed to change
# anything during startup. Temp workaround.
# pylint: disable=protected-access
self.app._on_startup.freeze()
await self.app.startup()
if self.ssl_certificate:
try:
if self.ssl_profile == SSL_INTERMEDIATE:
@@ -335,6 +329,7 @@ class HomeAssistantHTTP:
# However in Home Assistant components can be discovered after boot.
# This will now raise a RunTimeError.
# To work around this we now prevent the router from getting frozen
# pylint: disable=protected-access
self.app._router.freeze = lambda: None
self.runner = web.AppRunner(self.app)