I'd like to force a timeout after 5 seconds so other devices don't hang. What's the preferred way to do that? Here's my function call :
- Code: Select all
try:
tv = samsungtvws.SamsungTVWS(host=ipaddress, port=8002, token_file=token_file)
info = tv.rest_device_info()
tvState = info['device']['PowerState']
self.logger.debug(tvState)
except Exception as m:
#self.logger.debug("Error when accessing device: " + str(m))
self.logger.debug("Could be off. Skipping...")
device.updateStateOnServer("status", "off")
device.updateStateImageOnServer(indigo.kStateImageSel.SensorOff)
return