From 7d1fbe9ce9f0df01bb5e241bda6b8be148b5a3fe Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Tue, 7 Jul 2020 08:59:05 +0200 Subject: [PATCH] api/_common/Light: add reset to system behavior This makes lights behave as they would if the user script did not use them at all. --- pybricks/_common.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pybricks/_common.py b/pybricks/_common.py index 2766767..8db83b1 100644 --- a/pybricks/_common.py +++ b/pybricks/_common.py @@ -422,6 +422,11 @@ class Light: time (:ref:`time`): Duration of the pattern. """ + def reset(self): + """Resets the light to the default system behavior.""" + # This method is exposed on system lights only. + pass + class ColorLight: """Control a multi-color light.""" @@ -468,6 +473,11 @@ class ColorLight: time (:ref:`time`): Duration of the pattern. """ + def reset(self): + """Resets the light to the default system behavior.""" + # This method is exposed on system lights only. + pass + class LightArray: """Control an array of single-color lights.""" @@ -587,11 +597,15 @@ class LightGrid: Arguments: character (str): The character or symbol to be displayed. - time (:ref:`time`): How long to show a character before showing - the next one. + pause (:ref:`time`): How long to show a character before showing + the next one. """ pass + def reset(self): + """Resets the light grid to the default system behavior.""" + pass + class KeyPad: """Get status of buttons on a keypad layout."""