This commit is contained in:
Constantin Gierczak--Galle 2023-12-15 17:47:57 +01:00
parent fb2ed2f016
commit 21ccbdb357

View file

@ -69,18 +69,19 @@ class AbstractLight:
self._enable_auto_update: bool = False self._enable_auto_update: bool = False
for key, rValueObject in self.__class__.__dict__.items(): for key, rValueObject in self.__class__.__dict__.items():
# On copie la valeur if isinstance(rValueObject, BaseReactiveValue):
val = deepcopy(rValueObject.value) # On copie la valeur
if isinstance(val, ReactiveMixin): val = deepcopy(rValueObject.value)
val.light = self if isinstance(val, ReactiveMixin):
val.key = key val.light = self
self._attrs_to_dmx[key] = rValueObject.attr_to_dmx() val.key = key
self._attrs_to_dmx[key] = rValueObject.attr_to_dmx()
for i, length, callback in rValueObject.dmx_to_attr(): for i, length, callback in rValueObject.dmx_to_attr():
for k in range(i, i + length): for k in range(i, i + length):
self._dmx_to_attrs[k] = (key, i, length, callback) self._dmx_to_attrs[k] = (key, i, length, callback)
# Finally set the attributes to their value # Finally set the attributes to their value
setattr(self, key, val) setattr(self, key, val)
self._enable_auto_update: bool = True self._enable_auto_update: bool = True
def register_universe(self, universe: "Universe") -> None: def register_universe(self, universe: "Universe") -> None: