diff options
author | Jakob Stendahl <jakobste@uio.no> | 2021-10-06 17:30:49 +0200 |
---|---|---|
committer | Jakob Stendahl <jakobste@uio.no> | 2021-10-06 17:30:49 +0200 |
commit | f911008c589efd6fc43b8a81c9208fd07f04c586 (patch) | |
tree | f5392de01d6d913f76f56668b0bbd113e5399ccd | |
parent | 3af8c73910997a0a6b766a3eb1d624a327356bbd (diff) | |
download | Luxcena-Neo-f911008c589efd6fc43b8a81c9208fd07f04c586.tar.gz Luxcena-Neo-f911008c589efd6fc43b8a81c9208fd07f04c586.zip |
:construction: Update after changes
-rw-r--r-- | NeoRuntime/builtin/static/script.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/NeoRuntime/builtin/static/script.py b/NeoRuntime/builtin/static/script.py index 0f07304..505ab67 100644 --- a/NeoRuntime/builtin/static/script.py +++ b/NeoRuntime/builtin/static/script.py @@ -1,16 +1,17 @@ -from luxcena_neo import NeoBehaviour, VariableType, utils +from luxcena_neo import NeoBehaviour, ColorVariable, utils import time class Main(NeoBehaviour): def declare_variables(self): - self.vars.declare("color", "#fafafa", VariableType.COLOR, self.set_color) + self.declare(ColorVariable("color", "#fafafa", on_change=self.set_color)) + self.declare(ColorVariable("color2", "#fafafa", on_change=self.set_color)) def on_start(self): - print(f"Script started, color: {self.vars.color}") - self.set_color(self.vars.color) + print(f"Script started, color: {self.var.color}") + self.set_color(self.var.color) strip.power_on = True - # self.current_color = self.vars.color + self.current_color = self.var.color def set_color(self, value): print(f"Color var changed: {value}") |