sunix_ledstrip_controller_client.packets package¶
Submodules¶
sunix_ledstrip_controller_client.packets.requests module¶
-
class
sunix_ledstrip_controller_client.packets.requests.
GetTimeRequest
[source]¶ Bases:
construct.core.Struct
Request for the current time of the controller
-
class
sunix_ledstrip_controller_client.packets.requests.
SetCustomFunctionRequest
[source]¶ Bases:
construct.core.Struct
Request for setting a function
-
get_data
(colors: [(<class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>)], speed: int, transition_type: sunix_ledstrip_controller_client.packets.TransitionType) → dict[source]¶ Generates a binary data packet containing the request to set a function
Parameters: - colors – a list of color tuples of the form (red, green, blue) or (red, green, blue, unknown). I couldn’t figure out what the last parameter is used for so the rgb is a shortcut.
- transition_type – the transition type between colors
- speed – function speed [0..255] 0 is slow, 255 is fast
Returns: binary data packet
-
-
class
sunix_ledstrip_controller_client.packets.requests.
SetFunctionRequest
[source]¶ Bases:
construct.core.Struct
Request for setting a function
-
get_data
(function_id: sunix_ledstrip_controller_client.functions.FunctionId, speed: int) → dict[source]¶ Generates a binary data packet containing the request to set a function
Parameters: - function_id – ID of the function
- speed – function speed [0..255] 0 is slow, 255 is fast
Returns: binary data packet
-
-
class
sunix_ledstrip_controller_client.packets.requests.
SetPowerRequest
[source]¶ Bases:
construct.core.Struct
Request for changing the power state
-
class
sunix_ledstrip_controller_client.packets.requests.
SetTimeRequest
[source]¶ Bases:
construct.core.Struct
Request to set the current time of the controller
-
class
sunix_ledstrip_controller_client.packets.requests.
StatusRequest
[source]¶ Bases:
construct.core.Struct
Request for the current status of the controller
-
class
sunix_ledstrip_controller_client.packets.requests.
UpdateColorRequest
[source]¶ Bases:
construct.core.Struct
Request for changing the color state (incl. brightness)
-
get_rgb_data
(red: int, green: int, blue: int) → dict[source]¶ Generates a binary data packet containing the request to change rgb colors
Parameters: - red – red amount
- green – green amount
- blue – blue amount
Returns: binary data packet
-
get_rgbww_data
(red: int, green: int, blue: int, warm_white: int, cold_white: int) → dict[source]¶ Generates a binary data packet containing the request to change colors for all 5 channels
Parameters: - red – red amount
- green – green amount
- blue – blue amount
- warm_white – warm white amount
- cold_white – cold white amount
Returns: binary data packet
-
sunix_ledstrip_controller_client.packets.responses module¶
-
class
sunix_ledstrip_controller_client.packets.responses.
GetTimeResponse
(data: bytearray)[source]¶ Bases:
construct.core.Struct
The response to the GetTimeRequest request