diff light9/collector/collector.py @ 1302:24357038de9f

resolver does per-channel max() for color attributes Ignore-this: 6bba98291492058d190ef4948f9ec7fc
author Drew Perttula <drewp@bigasterisk.com>
date Mon, 30 May 2016 20:30:43 +0000
parents d51014267bfd
children 8863b4485fd4
line wrap: on
line diff
--- a/light9/collector/collector.py	Mon May 30 17:45:56 2016 +0000
+++ b/light9/collector/collector.py	Mon May 30 20:30:43 2016 +0000
@@ -3,7 +3,7 @@
 import logging
 from light9.namespaces import L9, RDF, DEV
 from light9.collector.output import setListElem
-from light9.collector.device import toOutputAttrs
+from light9.collector.device import toOutputAttrs, resolve
 
 log = logging.getLogger('collector')
 
@@ -85,8 +85,10 @@
         deviceAttrs = {} # device: {attr: value}
         for _, _, settings in self.lastRequest.itervalues():
             for (device, attr), value in settings.iteritems():
-                # resolving conflicts goes around here
-                deviceAttrs.setdefault(device, {})[attr] = value
+                attrs = deviceAttrs.setdefault(device, {})
+                if attr in attrs:
+                    value = resolve(device, attr, [attrs[attr], value])
+                attrs[attr] = value
 
         outputAttrs = {} # device: {attr: value}
         for d in deviceAttrs: