redsun.device.sharedbox¶
BoxDeviceConnector
¶
Bases: DeviceConnector
Connect a device to the boxes of a service.
The top device attaches the index and the boxes of the service and fills itself and its children from what the index describes. A child gets its part of the description from its parent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
declared_only
|
bool
|
Fill only the signals, commands and children the device declares,
and skip the rest of what the service serves. Declared children
follow the same rule, and a declared |
False
|
BoxSignalBackend
¶
Bases: SignalBackend[SignalDatatypeT]
A signal backed by one attribute of a controller box.
connect
async
¶
Check the declared datatype against the description.
Raises:
| Type | Description |
|---|---|
TypeError
|
The declared datatype is not what the service serves. |
put
async
¶
Write value and wait until the service has put it.
Raises:
| Type | Description |
|---|---|
TypeError
|
|
BoxPutError
|
The service refused the value or its put raised. |
get_datakey
async
¶
Return the data key, with the units, precision, limits and choices served.
set_callback
¶
Call callback with the current reading, then with each new one.
BoxCommandBackend
¶
Bases: CommandBackend[[], None]
A command backed by the request fields of a controller box.
execute
async
¶
Run the command and wait until the service has finished it.
Raises:
| Type | Description |
|---|---|
BoxPutError
|
The command raised in the service. |
BoxPutError
¶
stream_name
¶
Return the name of a stream the service publishes outside the controller boxes.
Raises:
| Type | Description |
|---|---|
ValueError
|
If |