Skip to content

component

borealis.component

Component()

Base component class.

Source code in borealis/component.py
13
14
def __init__(self):
    self._orchestrator = session_orchestrator

receive(message, **kwargs) abstractmethod

Receives and processes messages from the mediator.

Source code in borealis/component.py
21
22
23
@abstractmethod
def receive(self, message, **kwargs):
    """Receives and processes messages from the mediator."""

send(message, **kwargs)

Sends a message to the mediator.

Source code in borealis/component.py
16
17
18
19
def send(self, message, **kwargs):
    """Sends a message to the mediator."""
    LOGGER.debug('Sending message: %s', message)
    self._orchestrator.notify(sender=self, message=message, **kwargs)

ControllerComponent()

Bases: DeviceComponent

Base controller component class.

Source code in borealis/component.py
60
61
62
def __init__(self):
    super().__init__()
    self._orchestrator.add_controller_component(self)

receive(message, **kwargs)

Receives and processes messages from the mediator.

Source code in borealis/component.py
64
65
def receive(self, message, **kwargs):
    """Receives and processes messages from the mediator."""

DataComponent()

Bases: Component

Base data component class.

Source code in borealis/component.py
49
50
51
def __init__(self):
    super().__init__()
    self._orchestrator.add_data_component(self)

receive(message, **kwargs)

Receives and processes messages from the mediator.

Source code in borealis/component.py
53
54
def receive(self, message, **kwargs):
    """Receives and processes messages from the mediator."""

DeviceComponent()

Bases: Component

Source code in borealis/component.py
13
14
def __init__(self):
    self._orchestrator = session_orchestrator

get_device_info() abstractmethod

Must return a DeviceInfo object containing: - alias: unique identifier for this component - metadata: dictionary of device metadata

Source code in borealis/component.py
27
28
29
30
31
32
33
@abstractmethod
def get_device_info(self) -> DeviceInfo:
    """
    Must return a DeviceInfo object containing:
        - alias: unique identifier for this component
        - metadata: dictionary of device metadata
    """

SensorComponent()

Bases: DeviceComponent

Base sensor component class.

Source code in borealis/component.py
38
39
40
def __init__(self):
    super().__init__()
    self._orchestrator.add_sensor_component(self)

receive(message, **kwargs)

Receives and processes messages from the mediator.

Source code in borealis/component.py
42
43
def receive(self, message, **kwargs):
    """Receives and processes messages from the mediator."""