/      日本語

mwings.serializers.app_pal_notice Module

mwings.serializers.app_pal_notice

Serializers that generate commands representing packets to be sent to the PAL App (Notification PAL), and the data structures to handle them.

src/mwings/serializers/app_pal_notice.py

CommandSerializer

A static class serializer that generates commands representing packets to be sent to the PAL App (Notification PAL).

Inherits: common.CommandSerializerBase

serialize()

serialize(command)

Expands the given command into a raw packet byte sequence.

Arguments

NameTypeDescription
commandCommandCommand data

Returns

TypeValueDescription
optional common.BarePacketcommon.BarePacketExpanded data
NoneInvalid 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

Command()

Command(*, destination_logical_id=120, color=AppPalNoticeColor.WHITE, blink_speed=AppPalNoticeBlinkSpeed.ALWAYS_ON, brightness=8, duration_in_sec=5)

Arguments

NameTypeDescription
destination_logical_idcommon.UInt8Destination logical device ID
colorcommon.AppPalNoticeColorLighting color name
blink_speedcommon.AppPalNoticeBlinkSpeedBlinking speed
brightnesscommon.UInt8Brightness
duration_in_seccommon.UInt8Total 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

TypeValueDescription
boolTrueValid
FalseInvalid

model_*()