sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..', '..'))) import pyhueapi from pyhueapi.preset import Preset from pyhueapi.light import Light from pyhueapi.lights import Lights from pyhueapi import hipchat_notification if __name__ == '__main__': lights = Lights() light_strip = lights.get(17) if not light_strip.is_on(): sys.exit(0) target_preset = Preset() # CT color mode color_temperature = 340 # Percentage target_brightness_percent = 80 # Parse any command-line arguments. target_preset.parse_arguments() color_choices = {} color_choices['red'] = [0.703, 0.296] color_choices['magenta'] = [0.3681, 0.1683] color_choices['purple'] = [0.2977, 0.1415] color_choices['blue'] = [0.1393,0.0813]
#!/usr/bin/python import os, sys # If you're running from the app root this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.curdir, '..', '..'))) # If you're running this from anywhere else this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..', '..'))) import pyhueapi from pyhueapi.preset import Preset from pyhueapi import hipchat_notification if __name__ == '__main__': target_preset = Preset() # CT color mode color_temperature = 340 # Percentage target_brightness_percent = 100 overhead_brightness_precent = 30 # Parse any command-line arguments. target_preset.parse_arguments() # Define the preset target_preset.define_preset([ {'id': 2, 'on': True, 'bri': target_brightness_percent, 'ct': color_temperature}, {'id': 10, 'on': True, 'bri': target_brightness_percent, 'ct': color_temperature}, {'id': 12, 'on': True, 'bri': target_brightness_percent, 'ct': color_temperature}
#!/usr/bin/python import os, sys # If you're running from the app root this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.curdir, '..', '..'))) # If you're running this from anywhere else this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..', '..'))) import pyhueapi from pyhueapi.preset import Preset from pyhueapi import hipchat_notification if __name__ == '__main__': target_preset = Preset() # CT color mode color_temperature = 340 # Percentage target_brightness_percent = 75 # Parse any command-line arguments. target_preset.parse_arguments() # Define the preset target_preset.define_preset([ {'id': 15, 'on': False, 'bri': target_brightness_percent, 'ct': color_temperature}, {'id': 16, 'on': False, 'bri': target_brightness_percent, 'ct': color_temperature}, ])
#!/usr/bin/python import os, sys # If you're running from the app root this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.curdir, '..', '..'))) # If you're running this from anywhere else this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..', '..'))) import pyhueapi from pyhueapi.preset import Preset from pyhueapi import hipchat_notification import pyhueapi.utils if __name__ == '__main__': target_preset = Preset() # CT color mode color_temperature = pyhueapi.utils.kelvin_to_ct(3400) # print color_temperature # import sys # sys.exit(0) # Percentage target_brightness_percent = 100 # Parse any command-line arguments. target_preset.parse_arguments() # Define the preset final_preset = []
print "Right now it is %s F" % current_temperature print "Today Forecast: %s to %s F" % (today_forecast_low, today_forecast_high) print "Tomorrow Forecast: %s to %s F" % (tomorrow_forecast_low, tomorrow_forecast_high) print '-' * 80 print "Right Now color: %s" % determine_color(current_temperature) print "Today Low color: %s" % determine_color(today_forecast_low) print "Today High color: %s" % determine_color(today_forecast_high) print "Tomorrow Low color: %s" % determine_color(tomorrow_forecast_low) print "Tomorrow High color: %s" % determine_color(tomorrow_forecast_high) color_current_temperature = determine_color(current_temperature) color_today_low = determine_color(today_forecast_low) color_today_high = determine_color(today_forecast_high) color_tomorrow_low = determine_color(tomorrow_forecast_low) color_tomorrow_high = determine_color(tomorrow_forecast_high) target_preset = Preset() target_preset.parse_arguments() top_color = color_today_high mid_color = color_current_temperature bot_color = color_today_high target_preset.define_preset([ {'id': 10, 'on': True, 'bri': 100, 'xy': top_color, 'transitiontime': 10000 }, {'id': 2, 'on': True, 'bri': 100, 'xy': mid_color, 'transitiontime': 10000 }, {'id': 12, 'on': True, 'bri': 100, 'xy': top_color, 'transitiontime': 10000 }, ]) target_preset.execute()
#!/usr/bin/python import os, sys # If you're running from the app root this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.curdir, "..", ".."))) # If you're running this from anywhere else this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", ".."))) import pyhueapi from pyhueapi.preset import Preset from pyhueapi import hipchat_notification if __name__ == "__main__": target_preset = Preset() # CT color mode color_temperature = 340 # Percentage target_brightness_percent = 80 # Parse any command-line arguments. target_preset.parse_arguments() # Define the preset first_color = [0.408, 0.517] second_color = [0.168, 0.041] target_preset.define_preset( [
config_file=None, ) # If you're running from the app root this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.curdir, "..", ".."))) # If you're running this from anywhere else this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", ".."))) import pyhueapi from pyhueapi.preset import Preset from pyhueapi import hipchat_notification if __name__ == "__main__": target_preset = Preset() # CT color mode # color_temperature = 340 color_temperature = 340 # Percentage front_lights_brightness = 30 back_lights_brightness = 30 # Parse any command-line arguments. target_preset.parse_arguments() # Define the preset preset_list = [] for light_id in [2, 10, 12, 19, 20, 21, 22, 23, 24]:
#!/usr/bin/python import os, sys # If you're running from the app root this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.curdir, '..', '..'))) # If you're running this from anywhere else this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..', '..'))) import pyhueapi from pyhueapi.preset import Preset from pyhueapi import hipchat_notification if __name__ == '__main__': target_preset = Preset() # CT color mode color_temperature = 340 # Percentage target_brightness_percent = 100 overhead_brightness_precent = 30 # Parse any command-line arguments. target_preset.parse_arguments() # Define the preset target_preset.define_preset([ # {'id': 2, 'on': True, 'bri': target_brightness_percent, 'ct': color_temperature}, # {'id': 10, 'on': True, 'bri': target_brightness_percent, 'ct': color_temperature}, # {'id': 12, 'on': True, 'bri': target_brightness_percent, 'ct': color_temperature},
#!/usr/bin/python import os, sys # If you're running from the app root this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.curdir, '..', '..'))) # If you're running this from anywhere else this will make it work sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..', '..'))) import pyhueapi from pyhueapi.preset import Preset from pyhueapi import hipchat_notification if __name__ == '__main__': target_preset = Preset() # CT color mode color_temperature = 340 # xy_color = [0.139, 0.081] # Blue xy_color = [0.3133, 0.3289] # White # Percentage target_brightness_percent = 10 # Parse any command-line arguments. target_preset.parse_arguments() # Define the preset target_preset.define_preset([ # {'id': 2, 'on': False, 'bri': target_brightness_percent, 'ct': color_temperature}, # Triple Lamp # {'id': 10, 'on': False, 'bri': target_brightness_percent, 'ct': color_temperature}, # Triple Lamp