Skip to content

Commit 82676ab

Browse files
Merge pull request #47 from jbchouinard/limitlessled
Add support for v6 RGB+CCT 8 Zone lights
2 parents c2ad894 + f65155a commit 82676ab

32 files changed

+909
-576
lines changed

.github/workflows/python.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Python
2+
on:
3+
- push
4+
- pull_request
5+
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: astral-sh/ruff-action@v3
12+
name: Ruff check format
13+
with:
14+
args: "format --check --diff"
15+
- uses: astral-sh/ruff-action@v3
16+
name: Ruff check
17+
with:
18+
args: "check"
19+
20+
test:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
25+
26+
steps:
27+
- uses: actions/checkout@v3
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
python -m pip install tox tox-gh-actions
36+
- name: Test with tox
37+
run: tox

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# asdf config
2+
.tool-versions
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
*.py[cod]
@@ -24,6 +27,8 @@ wheels/
2427
*.egg-info/
2528
.installed.cfg
2629
*.egg
30+
.ruff_cache
31+
poetry.lock
2732

2833
# PyInstaller
2934
# Usually these files are written by a python script from a template
@@ -78,6 +83,7 @@ celerybeat-schedule
7883

7984
# dotenv
8085
.env
86+
.envrc
8187

8288
# virtualenv
8389
.venv/

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 happyleavesaoc
3+
Copyright (c) 2015-2021 happyleavesaoc
4+
Copyright (c) 2025 Jerome Boisvert-Chouinard
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy of
67
this software and associated documentation files (the "Software"), to deal in

Makefile

Lines changed: 0 additions & 9 deletions
This file was deleted.

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
[![Build Status](https://travis-ci.org/happyleavesaoc/python-limitlessled.svg?branch=master)](https://travis-ci.org/happyleavesaoc/python-limitlessled) [![PyPI version](https://badge.fury.io/py/limitlessled.svg)](https://badge.fury.io/py/limitlessled)
2-
31
# python-limitlessled
42

5-
`python-limitlessled` controls LimitlessLED bridges. It supports `white`, `rgbw` and `rgbww` bulb groups as well as the `bridge-led` of newer wifi bridges.
3+
[![PyPI version](https://img.shields.io/pypi/v/litmitlessled.svg)](https://pypi.org/project/limitlessled/)
4+
[![Python Tests](https://github.com/happyleavesaoc/python-limitlessled/actions/workflows/python.yaml/badge.svg)](https://github.com/happyleavesaoc/python-limitlessled/actions/workflows/python.yaml)
5+
6+
`python-limitlessled` controls LimitlessLED bridges (sold under various brand names such as MiLight, MiBoxer, EasyBulb, etc.).
7+
It supports `white`, `rgbw`, `rgbww`, and `rgbcct` bulb groups as well as the `bridge-led` of newer wifi bridges.
8+
9+
Light types:
10+
- `white`: White bulbs, 4 zones
11+
- `rgbw`: RGB + white bulbs , 4 zones
12+
- `rgbww`: RGB + cool/warm white bulbs, 4 zones
13+
- `rgbcct`: Newer RGB+CCT bulbs and LED strip controllers, 8 zones
14+
- `bridge-led`: Integrated LED on newer WiFi bridges
15+
616
## Install
717
`pip install limitlessled`
818

@@ -13,6 +23,7 @@ Your bridge(s) must be set up and bulbs joined prior to using this module.
1323
Group names can be any string, but must be unique amongst all bridges.
1424
```python
1525
from limitlessled.bridge import Bridge
26+
from limitlessled.group.rgbcct import RGBCCT
1627
from limitlessled.group.rgbw import RGBW
1728
from limitlessled.group.rgbww import RGBWW
1829
from limitlessled.group.white import WHITE
@@ -23,6 +34,8 @@ bridge.add_group(1, 'bedroom', RGBW)
2334
bridge.add_group(2, 'bathroom', WHITE)
2435
bridge.add_group(2, 'living_room', RGBW)
2536
bridge.add_group(2, 'kitchen', RGBWW)
37+
# RGBCCT supports up to 8 zones (groups)
38+
bridge.add_group(6, 'office', RGBCCT)
2639
```
2740

2841
Get access to groups either via the return value of `add_group`, or with the `LimitlessLED` object.
@@ -88,7 +101,7 @@ pipeline = Pipeline() \
88101
.on() \
89102
.brightness(0.7) \
90103
.color(0, 0, 255) \
91-
.transition(color=Color(255, 0, 0))
104+
.transition(3, color=Color(255, 0, 0))
92105

93106
bedroom.enqueue(pipeline)
94107
```

examples/pipeline.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from limitlessled import Color
2+
from limitlessled.bridge import Bridge
3+
from limitlessled.group.rgbcct import RGBCCT
4+
from limitlessled.group.rgbw import RGBW
5+
from limitlessled.group.rgbww import RGBWW
6+
from limitlessled.group.white import WHITE
7+
from limitlessled.pipeline import Pipeline
8+
9+
bridge = Bridge("<your bridge ip address>")
10+
bedroom = bridge.add_group(1, "bedroom", RGBW)
11+
# A group number can support two groups as long as the types differ
12+
bathroom = bridge.add_group(2, "bathroom", WHITE)
13+
living_room = bridge.add_group(2, "living_room", RGBW)
14+
kitchen = bridge.add_group(2, "kitchen", RGBWW)
15+
# RGBCCT supports up to 8 zones (groups)
16+
office = bridge.add_group(6, "office", RGBCCT)
17+
18+
selected = office
19+
commands = (
20+
Pipeline()
21+
.off()
22+
.wait(3)
23+
.on()
24+
.brightness(0.7)
25+
.color(0, 0, 255)
26+
.transition(3, color=Color(255, 0, 0))
27+
)
28+
selected.enqueue(commands)
29+
bridge.finish()

limitlessled/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
""" LimitlessLED.
1+
"""LimitlessLED.
22
33
http://www.limitlessled.com
44
"""
55

6-
import logging
76
from collections import namedtuple
7+
import logging
88

99
_LOGGER = logging.getLogger(__name__)
1010

@@ -20,21 +20,22 @@
2020

2121

2222
class LimitlessLED(object):
23-
""" Represents a LimitlessLED installation. """
23+
"""Represents a LimitlessLED installation."""
24+
2425
def __init__(self):
25-
""" Initialize. """
26+
"""Initialize."""
2627
self._groups = {}
2728

2829
def group(self, name):
29-
""" Fetch a named group.
30+
"""Fetch a named group.
3031
3132
:param name: Name of group.
3233
:returns: Group.
3334
"""
3435
return self._groups[name]
3536

3637
def add_bridge(self, bridge):
37-
""" Add bridge groups.
38+
"""Add bridge groups.
3839
3940
:param bridge: Add groups from this bridge.
4041
"""

0 commit comments

Comments
 (0)