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

get_data() → dict[source]

Generates a binary data packet containing the a request for the current time of the controller :return: binary data packet

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

get_data(on: bool) → dict[source]

Generates a binary data packet containing the request to change the power state of the controller

Parameters:on – True if the controller should turn on, False for turning off
Returns:binary data packet
class sunix_ledstrip_controller_client.packets.requests.SetTimeRequest[source]

Bases: construct.core.Struct

Request to set the current time of the controller

get_data(dt: <module 'datetime' from '/usr/lib/python3.5/datetime.py'>) → dict[source]

Generates a binary data packet containing the a request for the current time of the controller :return: binary data packet

class sunix_ledstrip_controller_client.packets.requests.StatusRequest[source]

Bases: construct.core.Struct

Request for the current status of the controller

get_data() → dict[source]

Generates a binary data packet containing the a request for the current state of the controller :return: binary data packet

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

get_ww_data(warm_white: int, cold_white: int) → dict[source]

Generates a binary data packet containing the request to change ww colors

Parameters:
  • 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

evaluate() → bool[source]
Returns:True if this response is valid, false otherwise
get_response() → dict[source]
Returns:the response in the expected format
class sunix_ledstrip_controller_client.packets.responses.StatusResponse(data: bytearray)[source]

Bases: construct.core.Struct

The response to the StatusRequest request

evaluate() → bool[source]
Returns:True if this response is valid, false otherwise
get_response() → dict[source]
Returns:the response in the expected format

Module contents

class sunix_ledstrip_controller_client.packets.TransitionType[source]

Bases: enum.Enum

The transition type between colors of a custom function

Gradual = 58
Jumping = 59
Strobe = 60