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:
|
if data.find('<BinaryState>1</BinaryState>') != -1:
|
||||||
# on
|
# on
|
||||||
dbg("Responding to ON for %s" % self.name)
|
dbg("Responding to ON for %s" % self.name)
|
||||||
success = self.action_handler.on()
|
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:
|
elif data.find('<BinaryState>0</BinaryState>') != -1:
|
||||||
# off
|
# off
|
||||||
dbg("Responding to OFF for %s" % self.name)
|
dbg("Responding to OFF for %s" % self.name)
|
||||||
success = self.action_handler.off()
|
try:
|
||||||
|
success = self.action_handler.off()
|
||||||
|
except Exception as e:
|
||||||
|
dbg("WARNING: Failed to turn OFF: %s" % str(e))
|
||||||
else:
|
else:
|
||||||
dbg("Unknown Binary State request:")
|
dbg("Unknown Binary State request:")
|
||||||
dbg(data)
|
dbg(data)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user