From c59b8a12fc6a502da9703b96ef6895abda6a5503 Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 11 Apr 2016 20:43:13 -0400 Subject: [PATCH] fixed call to nonexistent datetime() function... should be datestamp() --- hue_off.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hue_off.py b/hue_off.py index e351587..5635b43 100755 --- a/hue_off.py +++ b/hue_off.py @@ -92,15 +92,18 @@ def main(argv): try: lights_list = bridge.get_light_objects('list') - + lights_file = open("off.lights", 'w') + lights_file.truncate() # Store list of lights that are currently off off_lights = [] for light in lights_list: if not light.on: off_lights.append(light) + lights_file.write(light) + lights_file.write("\n") except: # Bridge unavailable, Power failure? - print "%s: Connection to Hue Bridge has failed... is the power out?" % datetime() + print "%s: Connection to Hue Bridge has failed... is the power out?" % datestamp() #Pause time.sleep(check_interval)