# HG changeset patch # User drewp@bigasterisk.com # Date 1402813173 0 # Node ID a88d5c76d2ff2fcb2ef026ff6c75e6e3d89e4442 # Parent 423941a4b4896258620cd309bd7ac1f422445eb0 submaster don't abort subs that have dangling links in them Ignore-this: b6e1dd023112d07e0d8c89e9265f86c4 diff -r 423941a4b489 -r a88d5c76d2ff light9/Submaster.py --- a/light9/Submaster.py Sun Jun 15 06:18:06 2014 +0000 +++ b/light9/Submaster.py Sun Jun 15 06:19:33 2014 +0000 @@ -168,16 +168,20 @@ log.debug(" lightLevel %s %s", self.uri, lev) chan = self.graph.value(lev, L9['channel']) + val = self.graph.value(lev, L9['level']) + if val is None: + # broken lightLevel link- may be from someone deleting channels + log.warn("sub %r has lightLevel %r with channel %r " + "and level %r" % (self.uri, lev, chan, val)) + continue + log.debug(" new val %r", val) + if val == 0: + continue name = self.graph.label(chan) if not name: log.error("sub %r has channel %r with no name- " "leaving out that channel" % (self.name, chan)) continue - val = self.graph.value(lev, L9['level']) - if val is None: - raise ValueError("sub %r has lightLevel %r with channel %r " - "and level %r" % (self.uri, lev, chan, val)) - log.debug(" new val %r", val) try: self.levels[name] = float(val) except: