Skip to main content

Control LimitlessLED, Milight, etc. products.

Project description

python-limitlessled8z

A fork of python-limitlessled which adds support for RGB-CCT 8 zone LED bulbs and strips.

python-limitlessled8z controls LimitlessLED bridges (sold under various brand names such as MiLight, MiBoxer, EasyBulb, etc.). It supports white, rgbw, rgbww, and rgbcct bulb groups as well as the bridge-led of newer wifi bridges.

Bulb types: white: White bulbs, 4 zones rgbw: RGB + white bulbs , 4 zones rgbww: RGB + cool/warm white bulbs, 4 zones rgbcct: Newer RGB+CCT bulbs and LED strip controllers, 8 zones bridge-led: Integrated LED on newer WiFi bridges

Install

pip install limitlessled8z

Usage

Configure

Your bridge(s) must be set up and bulbs joined prior to using this module.

Group names can be any string, but must be unique amongst all bridges.

from limitlessled.bridge import Bridge
from limitlessled.group.rgbcct import RGBCCT
from limitlessled.group.rgbw import RGBW
from limitlessled.group.rgbww import RGBWW
from limitlessled.group.white import WHITE

bridge = Bridge('<your bridge ip address>')
bridge.add_group(1, 'bedroom', RGBW)
# A group number can support two groups as long as the types differ
bridge.add_group(2, 'bathroom', WHITE)
bridge.add_group(2, 'living_room', RGBW)
bridge.add_group(2, 'kitchen', RGBWW)
# RGBCCT supports up to 8 zones (groups)
bridge.add_group(6, 'office', RGBCCT)

Get access to groups either via the return value of add_group, or with the LimitlessLED object.

bedroom = bridge.add_group(1, 'bedroom', RGBW)
# or
limitlessled = LimitlessLED()
limitlessled.add_bridge(bridge)
bedroom = limitlessled.group('bedroom')

# The bridge led can be controlled and acts as a RGBW group
bridge_led = bridge.bridge_led

Control

Turn on:

bedroom.on = True

Change brightness:

bedroom.brightness = 0.5 # 0.0 through 1.0

Change temperature (white groups only)

bedroom.temperature = 0.5 # 0.0 through 1.0

Change color (rgbw groups only)

LimitlessLED RGBW bulbs can represent only the hue component of RGB color. There are 256 possible values, starting with blue as 0. Maximum saturation and value are always used. This means that most RGB colors are not supported. There are two special cases: Black (0, 0, 0) is simply all LEDs turned off. White (255, 255, 255) is the RGB LEDs off and the white LED on. Note that the actual color of the white LED depends on whether the bulb is a cool white or a warm white bulb.

from limitlessled import Color
bedroom.color = Color(255, 0, 0) # red

Transition

bedroom.transition(brightness=1.0, temperature=0.1) # white groups

from limitlessled import Color
bedroom.transition(brightness=1.0, color=Color(0, 255, 0)) # rgbw groups

Pipelines

Pipelines specify a sequence of stages, each stage being a command. Pipelines are not executed until called as an argument to a group's enqueue method.

Pipelines are executed in a thread (per group). Multiple pipelines can be started on a group; they will queue and execute in the order received.

A bridge can run multiple pipelines concurrently provided they are on different groups. Note that concurrency is achieved by interleaving commands, and as a consequence, pipeline execution can take longer than specified and each pipeline may use fewer transition steps depending on the number of concurrently executing pipelines.

from limitlessled import Color
from limitlessled.pipeline import Pipeline

pipeline = Pipeline() \
    .on() \
    .brightness(0.7) \
    .color(0, 0, 255) \
    .transition(3, color=Color(255, 0, 0))
    
bedroom.enqueue(pipeline)

Stop the currently-running pipeline:

bedroom.stop()
Commands

Turn on

Pipeline().on()

Turn off

Pipeline().off()

Set brightness

Pipeline().brightness(0.5)

Set temperature

Pipeline().temperature(0.5)

Set color

Pipeline().color(255, 0, 0)

Transition

Pipeline().transition(...)

Wait

Pipeline.().wait(4) # in seconds

Repeat

stages is how many previous stages to repeat iterations is how many times to repeat stages

Default stages is 1, default iterations is infinite.

Pipeline().repeat(stages=2, iterations=3)

Callback

def my_function():
    pass

Pipeline().callback(my_function)

Append

p1 = Pipeline.off()

p2 = Pipeline.on().append(p1)

Contributions

Pull requests welcome. Some areas for enhancement include

  • Discovery
  • Pairing

Disclaimer

Not affiliated with LimitlessLED and/or marketers/manufacturers of rebranded devices.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

limitlessled8z-1.2.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

limitlessled8z-1.2.0-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file limitlessled8z-1.2.0.tar.gz.

File metadata

  • Download URL: limitlessled8z-1.2.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.5 Linux/6.15.5-arch1-1

File hashes

Hashes for limitlessled8z-1.2.0.tar.gz
Algorithm Hash digest
SHA256 7e6128f0c968e0b3df580d41210e67e313feb75f6c818babd185bbadcfd3dd61
MD5 44d9f04ba1d187136ad92e139469481f
BLAKE2b-256 a9db41aab8daf97f86ca143bba908161e5cc29ba13c77898b380a0ffcc93cdef

See more details on using hashes here.

File details

Details for the file limitlessled8z-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: limitlessled8z-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.5 Linux/6.15.5-arch1-1

File hashes

Hashes for limitlessled8z-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66d1d5bd4b589fd727d6972b3224aababe523ae8f473f27c32b0469f9ec8fe8b
MD5 19ba65c2e09a66c23184c63321d6fcc2
BLAKE2b-256 e22fb70ced55b3407b9324b131c331095059a3bb176d2d1dabfff72075818a02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page