Beispiel #1
0
def brightness(name, brightness, colour_temp):
    """ set brightness of device"""
    dev_props = get_device_from_config(config, name)
    dev = BulbDevice(dev_props["id"], dev_props["ip"], dev_props["key"])
    if colour_temp is None:
        dev.set_brightness(brightness)
    else:
        dev.set_white(brightness=brightness, colour_temp=colour_temp)
def state(name):
    """ prints the current state of device specified via NAME """
    dev_props = get_device_from_config(config, name)
    print(json.dumps(get_json_state(dev_props)))
def off(name, switch):
    """ sends turn off action to device specified via NAME """
    dev_props = get_device_from_config(config, name)
    dev = OutletDevice(dev_props["id"], dev_props["ip"], dev_props["key"])
    dev.turn_off(switch=switch)
Beispiel #4
0
def colour(name, r, g, b):
    """ set colour of device using provided R, G, B (red green and blue)"""
    dev_props = get_device_from_config(config, name)
    dev = BulbDevice(dev_props["id"], dev_props["ip"], dev_props["key"])
    dev.set_colour(r, g, b)
Beispiel #5
0
def off(name):
    """ sends turn off action to device """
    dev_props = get_device_from_config(config, name)
    dev = BulbDevice(dev_props["id"], dev_props["ip"], dev_props["key"])
    dev.turn_off()