use WebSocketState from fastapi

available since 0.82.0
This commit is contained in:
Matthias 2022-09-13 20:12:02 +02:00
parent aeaca78940
commit 79c70bd52d

View File

@ -1,10 +1,9 @@
import logging import logging
from typing import Any, Dict from typing import Any, Dict
from fastapi import APIRouter, Depends, WebSocket, WebSocketDisconnect from fastapi import APIRouter, Depends, WebSocketDisconnect
from fastapi.websockets import WebSocket, WebSocketState
from pydantic import ValidationError from pydantic import ValidationError
# fastapi does not make this available through it, so import directly from starlette
from starlette.websockets import WebSocketState
from freqtrade.enums import RPCMessageType, RPCRequestType from freqtrade.enums import RPCMessageType, RPCRequestType
from freqtrade.rpc.api_server.api_auth import validate_ws_token from freqtrade.rpc.api_server.api_auth import validate_ws_token