sunix_ledstrip_controller_client package

Submodules

sunix_ledstrip_controller_client.client module

Example usage of the LEDStripControllerClient can be found in the example.py file

class sunix_ledstrip_controller_client.client.LEDStripControllerClient[source]

Bases: object

This class is the main interface for controlling all devices

discover_controllers() → [<class 'sunix_ledstrip_controller_client.controller.Controller'>][source]

Sends a broadcast message to the local network. Listening devices will respond to this broadcast with their self description

Returns:a list of devices
get_function_list() → [<enum 'FunctionId'>][source]
Returns:a list of all supported functions
get_time(controller: sunix_ledstrip_controller_client.controller.Controller) → <module 'datetime' from '/usr/lib/python3.5/datetime.py'>[source]

Receives the current time of the controller

Parameters:controller – the controller to use
Returns:the current time of the controller
set_custom_function(controller: sunix_ledstrip_controller_client.controller.Controller, color_values: [(<class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>)], speed: int, transition_type: sunix_ledstrip_controller_client.packets.TransitionType = <TransitionType.Gradual: 58>)[source]

Sets a custom function on the specified controller

Parameters:
  • controller – the controller to set the function on
  • color_values – a list of up to 16 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
set_function(controller: sunix_ledstrip_controller_client.controller.Controller, function_id: sunix_ledstrip_controller_client.functions.FunctionId, speed: int)[source]

Sets a function on the specified controller

Parameters:
  • controller – the controller to set the function on
  • function_id – Function ID
  • speed – function speed [0..255] 0 is slow, 255 is fast
set_rgb(controller: sunix_ledstrip_controller_client.controller.Controller, red: int, green: int, blue: int) → None[source]

Sets rgbw values for the specified controller.

Parameters:
  • controller – the controller to set the specified values on
  • red – red intensity (0..255)
  • green – green intensity (0..255)
  • blue – blue intensity (0..255)
set_rgbww(controller: sunix_ledstrip_controller_client.controller.Controller, red: int, green: int, blue: int, warm_white: int, cold_white: int) → None[source]

Sets rgbww values for the specified controller.

Parameters:
  • controller – the controller to set the specified values on
  • red – red intensity (0..255)
  • green – green intensity (0..255)
  • blue – blue intensity (0..255)
  • warm_white – warm_white: warm white intensity (0..255)
  • cold_white – cold white intensity (0..255)
set_time(controller: sunix_ledstrip_controller_client.controller.Controller, date_time: <module 'datetime' from '/usr/lib/python3.5/datetime.py'>) → None[source]

Sets the internal time of the controller

Parameters:
  • controller – the controller to use
  • date_time – the time to set
set_ww(controller: sunix_ledstrip_controller_client.controller.Controller, warm_white: int, cold_white: int) → None[source]

Sets warm white value for the specified controller.

Parameters:
  • controller – the controller to set the specified values on
  • warm_white – warm white intensity (0..255)
  • cold_white – cold white intensity (0..255)
turn_off(controller: sunix_ledstrip_controller_client.controller.Controller) → None[source]

Turns on a controller :param controller: the controller to turn on

turn_on(controller: sunix_ledstrip_controller_client.controller.Controller) → None[source]

Turns on a controller :param controller: the controller to turn on

update_state(controller: sunix_ledstrip_controller_client.controller.Controller) → None[source]

Updates the state of the passed in controller

Parameters:controller – the controller to update

sunix_ledstrip_controller_client.controller module

class sunix_ledstrip_controller_client.controller.Controller(host: str, port: int = 5577, hardware_id: str = None, model: str = None)[source]

Bases: object

Device class that represents a single controller

DEFAULT_PORT = 5577
POWER_STATE_OFF = 36
POWER_STATE_ON = 35
get_brightness() → int[source]

Note: this value is calculated in the library and not on the device :return: the brightness of the controller [0..255] or None if no value is set

get_hardware_id() → str[source]
Returns:The hardware ID of this device (f.ex. ‘F0FE6B2333C6’)
get_host() → str[source]
Returns:The IP/Host address of this device
get_model() → str[source]
Returns:The model of this device
get_port() → int[source]
Returns:The port of this device
get_rgbww() → [<class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>][source]
Returns:the RGB color values
is_on() → bool[source]
Returns:True if the controller is turned on, false otherwise

Module contents