mwings.serializers.app_pal_notice_detailed Module
mwings.serializers.app_pal_notice_detailedSerializers that generate commands representing detailed packets to be sent to the PAL App (Notification PAL), and the data structures to handle them.
CommandSerializer
Static class serializer that generates commands representing detailed packets to be sent to the PAL App (Notification PAL).
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 for storing data used to generate commands representing detailed packets to be sent to the PAL App (Notification PAL).
Inherits from:
common.CommandBase
Members inherited from the base class are also listed.
Command()
Command(*, destination_logical_id=120, color=AppPalNoticeRGBWColor(red=0, green=0, blue=0, white=15), blink_duty_percentage=100, blink_period_in_sec=1.0, duration_in_sec=1)
Parameters
| Name | Type | Description |
|---|---|---|
destination_logical_id | common.UInt8 | Destination logical device ID |
color | common.AppPalNoticeRGBWColor | RGBW color for illumination |
blink_duty_percentage | common.UInt8 | Percentage of on-time during blinking |
blink_period_in_sec | common.Float64 | Blink period in seconds |
duration_in_sec | common.UInt8 | Total duration of illumination (blinking) |
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 of
pydantic.BaseModel.