hello, i have a fairly simple question. i am using the api for pinging insteon devices and i have the below script I've written. all it does is "ping" instead devices and sets 2 variables, one with true/false, the other with a numeric value. the script actually works except when the device is down. it just hangs. i wanted to put a hard break after 3 seconds and just return false/0 to the variables Im using. i looked into MANY ways to do this but none worked. I'm NOT a coder so this is probably pretty basic for someone! i hope thank you in advance! I've been working on getting something like this working for a long time and I'm soooo close now....
hvacPing = indigo.variables[7055203]
hvacResponse = indigo.variables[808718]
dev = indigo.devices[240906]
result = indigo.device.ping(dev, suppressLogging=True)
if result["Success"]:
indigo.variable.updateValue(hvacPing,"true"), indigo.variable.updateValue(hvacResponse,"%.3f" % (result["TimeDelta"]/1000.0))
else:
indigo.variable.updateValue(hvacPing, "false"), indigo.variable.updateValue(hvacResponse,"0")