changeset 2206:5b38db0369fc

add resolve() to DeviceSettings.__init__
author drewp@bigasterisk.com
date Mon, 22 May 2023 01:06:27 -0700
parents 71fa794c160c
children 0ff5adb554ba
files light9/effect/settings.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/light9/effect/settings.py	Mon May 22 01:05:06 2023 -0700
+++ b/light9/effect/settings.py	Mon May 22 01:06:27 2023 -0700
@@ -64,8 +64,14 @@
     def __init__(self, graph: GraphType, settingsList: List[Tuple[Any, Any, VTUnion]]):
         self.graph = graph  # for looking up all possible attrs
         self._compiled: Dict[self.__class__.EntityType, Dict[self.__class__.AttrType, VTUnion]] = {}
-        for row in settingsList:
-            self._compiled.setdefault(row[0], {})[row[1]] = row[2]
+        for e, a, v in settingsList:
+            attrVals = self._compiled.setdefault(e, {})
+            if a in attrVals:
+                v = resolve(
+                    e,  # Hey, this is supposed to be DeviceClass (which is not convenient for us), but so far resolve() doesn't use that arg
+                    a,
+                    [attrVals[a], v])
+            attrVals[a] = v
         # self._compiled may not be final yet- see _fromCompiled
         self._delZeros()