diff --git a/pybricks/_common.py b/pybricks/_common.py index ae0d47a..2056137 100644 --- a/pybricks/_common.py +++ b/pybricks/_common.py @@ -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')