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 2018-11-21 20:55:21 +01:00 committed by GitHub
parent 5b3e9399a9
commit 1341ecd2eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 43 additions and 45 deletions

View file

@ -96,11 +96,7 @@ def setup_auth(app, trusted_networks, use_auth,
request[KEY_AUTHENTICATED] = authenticated
return await handler(request)
async def auth_startup(app):
"""Initialize auth middleware when app starts up."""
app.middlewares.append(auth_middleware)
app.on_startup.append(auth_startup)
app.middlewares.append(auth_middleware)
def _is_trusted_ip(request, trusted_networks):