Changeset - a88d5c76d2ff
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 11 years ago 2014-06-15 06:19:33
drewp@bigasterisk.com
submaster don't abort subs that have dangling links in them
Ignore-this: b6e1dd023112d07e0d8c89e9265f86c4
1 file changed with 9 insertions and 5 deletions:
0 comments (0 inline, 0 general)
light9/Submaster.py
Show inline comments
 
@@ -168,16 +168,20 @@ class PersistentSubmaster(Submaster):
 
            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:
0 comments (0 inline, 0 general)