Use KEY_HASS [h-z] (#112610)
This commit is contained in:
parent
714777e853
commit
8ca127df2a
31 changed files with 82 additions and 80 deletions
|
@ -11,7 +11,7 @@ from typing import TYPE_CHECKING, Any, Final
|
|||
|
||||
from aiohttp import WSMsgType, web
|
||||
|
||||
from homeassistant.components.http import HomeAssistantView
|
||||
from homeassistant.components.http import KEY_HASS, HomeAssistantView
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||
from homeassistant.core import Event, HomeAssistant, callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||
|
@ -49,7 +49,7 @@ class WebsocketAPIView(HomeAssistantView):
|
|||
|
||||
async def get(self, request: web.Request) -> web.WebSocketResponse:
|
||||
"""Handle an incoming websocket connection."""
|
||||
return await WebSocketHandler(request.app["hass"], request).async_handle()
|
||||
return await WebSocketHandler(request.app[KEY_HASS], request).async_handle()
|
||||
|
||||
|
||||
class WebSocketAdapter(logging.LoggerAdapter):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue