From a86b733ccb31e9d01a8e9f8557883d0a9bbd78cd Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 11 Apr 2016 21:18:38 -0400 Subject: [PATCH] Removed IOError exception. Writing light name to file is working. Now need to read in and find light nased on name --- hue_off.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hue_off.py b/hue_off.py index 31943c3..bc7eb89 100755 --- a/hue_off.py +++ b/hue_off.py @@ -99,13 +99,12 @@ def main(argv): for light in lights_list: if not light.on: off_lights.append(light) - lights_file.write(light) + lights_file.write(light.name) lights_file.write("\n") - except IOError: - print "%s: File IO Error" % datestamp() + lights_file.close() except: - # Bridge unavailable, Power failure? - print "%s: Connection to Hue Bridge has failed... is the power out?" % datestamp() + # Unhandled exception! + print "%s: An Unhandled exception has appeared..." % datestamp() #Pause time.sleep(check_interval)