mwings.serializers.app_io Module
mwings.serializers.app_ioSerializers that generate commands representing packets to be sent to the remote control app, and the data structures to handle them.
CommandSerializer
Static class that serializes commands representing packets to be sent to the remote control app
Inherits from:
common.CommandSerializerBase
Members inherited from the base class are listed.
serialize()
serialize(command)
Expands the given command into a raw packet byte sequence.
Parameters
| Name | Type | Description |
|---|---|---|
command | Command | Command data |
Returns
| Type | Value | Description |
|---|---|---|
optional common.BarePacket | common.BarePacket | Expanded data |
None | Invalid command data |
Command
Data structure to hold data used to generate commands representing packets to be sent to the remote control app
Inherits from:
common.CommandBase
Members inherited from the base class are also listed.
Command()
Command(*, destination_logical_id=120, di_to_change=<mwings.common.FixedList object>, di_state=<mwings.common.FixedList object>)
Parameters
| Name | Type | Description |
|---|---|---|
destination_logical_id | common.UInt8 | Destination logical device ID |
di_to_change | common.FixedList[bool](12) | Digital interfaces to change |
di_state | common.FixedList[bool](12) | State of digital interfaces after change |
You can also pass a dictionary unpacked with
**.
is_valid()
is_valid()
Checks whether the command data is valid.
Parameters
None
Returns
| Type | Value | Description |
|---|---|---|
bool | True | Valid |
False | Invalid |
model_*()
In addition, you can use various methods from
pydantic.BaseModel.