mwings.serializers.app_pal_notice Module
mwings.serializers.app_pal_noticeSerializers that generate commands representing packets to be sent to the PAL App (Notification PAL), and the data structures to handle them.
CommandSerializer
A static class serializer that generates commands representing packets to be sent to the PAL App (Notification PAL).
Inherits:
common.CommandSerializerBase
The members inherited from the base class are listed.
serialize()
serialize(command)
Expands the given command into a raw packet 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
A structure to store parameters used when generating commands representing packets to be sent to the PAL App (Notification PAL).
Inherits:
common.CommandBase
Members inherited from the base class are also included.
Command()
Command(*, destination_logical_id=120, color=AppPalNoticeColor.WHITE, blink_speed=AppPalNoticeBlinkSpeed.ALWAYS_ON, brightness=8, duration_in_sec=5)
Arguments
| Name | Type | Description |
|---|---|---|
destination_logical_id | common.UInt8 | Destination logical device ID |
color | common.AppPalNoticeColor | Lighting color name |
blink_speed | common.AppPalNoticeBlinkSpeed | Blinking speed |
brightness | common.UInt8 | Brightness |
duration_in_sec | common.UInt8 | Total lighting (blinking) duration in seconds |
You can pass a dictionary unpacked with
**.
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 to the above, you can use various methods of
pydantic.BaseModel.