From 21ccbdb357422e4bc4d376137aabdeef21a830e7 Mon Sep 17 00:00:00 2001 From: Constantin Gierczak--Galle Date: Fri, 15 Dec 2023 17:47:57 +0100 Subject: [PATCH] Revert --- pyjecteur/lights.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pyjecteur/lights.py b/pyjecteur/lights.py index 112d1a3..fef42e3 100644 --- a/pyjecteur/lights.py +++ b/pyjecteur/lights.py @@ -69,18 +69,19 @@ class AbstractLight: self._enable_auto_update: bool = False for key, rValueObject in self.__class__.__dict__.items(): - # On copie la valeur - val = deepcopy(rValueObject.value) - if isinstance(val, ReactiveMixin): - val.light = self - val.key = key - self._attrs_to_dmx[key] = rValueObject.attr_to_dmx() + if isinstance(rValueObject, BaseReactiveValue): + # On copie la valeur + val = deepcopy(rValueObject.value) + if isinstance(val, ReactiveMixin): + val.light = self + val.key = key + self._attrs_to_dmx[key] = rValueObject.attr_to_dmx() - for i, length, callback in rValueObject.dmx_to_attr(): - for k in range(i, i + length): - self._dmx_to_attrs[k] = (key, i, length, callback) - # Finally set the attributes to their value - setattr(self, key, val) + for i, length, callback in rValueObject.dmx_to_attr(): + for k in range(i, i + length): + self._dmx_to_attrs[k] = (key, i, length, callback) + # Finally set the attributes to their value + setattr(self, key, val) self._enable_auto_update: bool = True def register_universe(self, universe: "Universe") -> None: