mwings.serializers.app_twelite Module
mwings.serializers.app_twelite
Serializers to generate commands representing packets for the Extremely Simple! Standard App, and data structures to handle them.
CommandSerializer
Static class to generate commands representing packets for the Extremely Simple! Standard App
Inherits:
common.CommandSerializerBase
Members inherited from the base class are listed.
serialize()
serialize(command)
Expands the given command into a raw byte sequence.
Arguments
Name | Type | Description |
---|---|---|
command | Command | Command data |
Returns
Type | Value | Description |
---|---|---|
optional common.BarePacket | common.BarePacket | Expanded data |
None | Invalid command data |
Command
Structure to store data used to generate commands representing packets for the Extremely Simple! Standard App
Inherits:
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>, pwm_to_change=<mwings.common.FixedList object>, pwm_duty=<mwings.common.FixedList object>)
Arguments
Name | Type | Description |
---|---|---|
destination_logical_id | common.UInt8 | Destination logical device ID |
di_to_change | common.FixedList[bool](4) | Digital interfaces to change |
di_state | common.FixedList[bool](4) | Digital interface states after change |
pwm_to_change | common.FixedList[bool](4) | PWM interfaces to change |
pwm_duty | common.FixedList[int](4) | PWM interface duty after change |
You can also pass a dictionary unpacked with
**
.
Values for
pwm_duty
should be between 0
and 1024
. A value of 0xFFFF
indicates invalid.is_valid()
is_valid()
Checks whether the command data is valid.
Arguments
None
Returns
Type | Value | Description |
---|---|---|
bool | True | Valid |
False | Invalid |
model_*()
In addition, you can use various methods from
pydantic.BaseModel
.