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 |
|
host_manager |
HostManagerService instance for Host Manager access |
Event
¶
EventRegistry
¶
Bases: RegistryBase
Registry for managing events and their handlers. Allows registering event handlers and callbacks.
register_callback(event_type, callback)
¶
Register a callback for an existing event.
register_event(event_type, handler, callbacks=None)
¶
Register an event with its handler and optional callbacks.
unregister_callback(event_type, callback)
¶
Unregister a callback for an existing event.
unregister_event(event_type)
¶
Unregister an event by its type.
BaseWebsocketConsumer
¶
Bases: AsyncWebsocketConsumer
This consumer handles WebSocket connections for whitebox.
BaseWebsocketEventConsumer
¶
Bases: BaseWebsocketConsumer
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: MessageThrottleMixin, BaseWebsocketEventConsumer