Skip to content

Whitebox

API

Standarized API of whitebox for plugins to interact with the core system.

Attributes:

Name Type Description
location

LocationService instance for interacting with the location service

traffic

TrafficService instance for interacting with the traffic service

status

StatusService instance for interacting with the status service

BaseWebsocketConsumer

Bases: AsyncWebsocketConsumer

This consumer handles WebSocket connections for whitebox.

connect() async

Called when client connects to the WebSocket.

disconnect(close_code) async

Called when client disconnects from the WebSocket.

receive(text_data) async

Called when client sends a message to the WebSocket.

Parameters:

Name Type Description Default
text_data str

The message sent by the client.

required

FlightConsumer

Bases: BaseWebsocketConsumer

location_update(data) async

Called when the core system emits a location update event.

Parameters:

Name Type Description Default
data dict

The data associated with the location update event.

required

status_update(data) async

Called when the core system emits a status update event.

Parameters:

Name Type Description Default
data dict

The data associated with the status update event.

required

traffic_update(data) async

Called when the core system emits a traffic update event.

Parameters:

Name Type Description Default
data dict

The data associated with the traffic update event.

required

EventHandlerFactory

Factory class for creating event handlers.

create_handler(event_type) classmethod

Create an event handler based on the event type.