api: standardize on method for light groups

Turn on all the lights at the specified brightness.
This commit is contained in:
Laurens Valk
2019-06-25 14:55:38 +02:00
parent 0b67db897e
commit 20b4307d05
+25 -7
View File
@@ -472,15 +472,12 @@ class LightArray():
"""
pass
def on(self, *brightnesses):
"""on(first_light, ..., last_light)
Set the brightness of each light.
def on(self, brightness=100):
"""Turn on all the lights at the specified brightness.
Arguments:
brightnesses (:ref:`brightness`, ..., :ref:`brightness`):
Brightness of each light. If you give just one value, all
lights turn on with that same brightness.
brightness (:ref:`brightness`):
Brightness of the lights (*Default*: 100).
"""
pass
@@ -488,6 +485,17 @@ class LightArray():
"""Turn off all the lights."""
pass
def array(self, *brightnesses):
"""array(first_light, ..., last_light)
Set the brightness of each light individually.
Arguments:
brightnesses (:ref:`brightness`, ..., :ref:`brightness`):
Brightness of each light.
"""
pass
class LightGrid():
"""Control a rectangular grid of single-color lights."""
@@ -522,6 +530,15 @@ class LightGrid():
"""
pass
def on(self, brightness=100):
"""Turn on all the pixels at the specified brightness.
Arguments:
brightness (:ref:`brightness`):
Brightness of the lights (*Default*: 100).
"""
pass
def off(self):
"""Turn off all the pixels."""
pass
@@ -601,6 +618,7 @@ light.rgb = ColorLight.rgb
lights = ModuleType('LightArray')
lights.on = LightArray.on
lights.array = LightArray.array
lights.off = LightArray.off
buttons = ModuleType('KeyPad')