add exception handling to the lights on/lights off action so script does not bail
This commit is contained in:
parent
4fd2ae599c
commit
9fa883f3e7
|
@ -235,11 +235,17 @@ class fauxmo(upnp_device):
|
|||
if data.find('<BinaryState>1</BinaryState>') != -1:
|
||||
# on
|
||||
dbg("Responding to ON for %s" % self.name)
|
||||
try:
|
||||
success = self.action_handler.on()
|
||||
except Exception as e:
|
||||
dbg("WARNING: Failed to turn ON: %s" % str(e))
|
||||
elif data.find('<BinaryState>0</BinaryState>') != -1:
|
||||
# off
|
||||
dbg("Responding to OFF for %s" % self.name)
|
||||
try:
|
||||
success = self.action_handler.off()
|
||||
except Exception as e:
|
||||
dbg("WARNING: Failed to turn OFF: %s" % str(e))
|
||||
else:
|
||||
dbg("Unknown Binary State request:")
|
||||
dbg(data)
|
||||
|
|
Loading…
Reference in New Issue
Block a user