Skip to content

Commit

Permalink
mavutil: import websocket libs in init function
Browse files Browse the repository at this point in the history
this allows a user to use pymavlink without these libraries installed so long as they don't try tyo use websockets
  • Loading branch information
peterbarker committed Aug 22, 2024
1 parent f2c89fe commit 2e707a7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mavutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1732,15 +1732,15 @@ def write(self, buf):

class mavwebsocket(mavfile):
'''Mavlink WebSocket server, single client only'''
from wsproto import ConnectionType, WSConnection, utilities
from wsproto.events import (
AcceptConnection,
CloseConnection,
Request,
BytesMessage,
)

def __init__(self, device, source_system=255, source_component=0, use_native=default_native):
from wsproto import ConnectionType, WSConnection, utilities
from wsproto.events import (
AcceptConnection,
CloseConnection,
Request,
BytesMessage,
)

self.ws = None

# This is a duplicate of mavtcpin
Expand Down

0 comments on commit 2e707a7

Please sign in to comment.