commit b464c7adfe8f1f190a86699d70938932cb9c2117 from: mischa date: Wed Jun 24 19:03:37 2020 UTC change colormodes commit - 17c6e3a632310fff5165f76e02002df768d6452b commit + b464c7adfe8f1f190a86699d70938932cb9c2117 blob - a75c136e6eff032e9a8f05fff25b92e331779250 blob + f910ecbd7c74b951a402da50a58469354b1f1543 --- lightctl.py +++ lightctl.py @@ -50,25 +50,25 @@ no_cert_check = ssl.create_default_context() no_cert_check.check_hostname=False no_cert_check.verify_mode=ssl.CERT_NONE -scenes = {'br': {}, 'ct': {}, 'xt': {}} +scenes = {'br': {}, 'ct': {}, 'xy': {}} scenes['br']['bright'] = b'{"on": true, "bri": 254, "alert": "none"}' +scenes['ct']['bright'] = b'{"on": true, "bri": 254, "ct": 367, "alert": "none"}' +scenes['xy']['bright'] = b'{"on": true, "bri": 254, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.4578, 0.41], "ct": 367, "alert": "none"}' scenes['br']['relax'] = b'{"on": true, "bri": 144, "alert": "none"}' +scenes['ct']['relax'] = b'{"on": true, "bri": 144, "ct": 447, "alert": "none"}' +scenes['xy']['relax'] = b'{"on": true, "bri": 144, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.5019, 0.4152], "ct": 447, "alert": "none"}' scenes['br']['morning'] = b'{"on": true, "bri": 100, "alert": "none"}' +scenes['ct']['morning'] = b'{"on": true, "bri": 100, "ct": 447, "alert": "none"}' +scenes['xy']['morning'] = b'{"on": true, "bri": 100, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.5019, 0.4152], "ct": 447, "alert": "none"}' scenes['br']['dimmed'] = b'{"on": true, "bri": 77, "alert": "none"}' +scenes['ct']['dimmed'] = b'{"on": true, "bri": 77, "ct": 367, "alert": "none"}' +scenes['xy']['dimmed'] = b'{"on": true, "bri": 77, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.4578, 0.41], "ct": 367, "alert": "none"}' scenes['br']['evening'] = b'{"on": true, "bri": 63, "alert": "none"}' +scenes['ct']['evening'] = b'{"on": true, "bri": 63, "ct": 447, "alert": "none"}' +scenes['xy']['evening'] = b'{"on": true, "bri": 63, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.5019, 0.4152], "ct": 447, "alert": "none"}' scenes['br']['nightlight'] = b'{"on": true, "bri": 1, "alert": "none"}' -scenes['ct']['bright'] = b'{"on": true, "bri": 254, "ct": 367, "alert": "none", "colormode": "ct"}' -scenes['ct']['relax'] = b'{"on": true, "bri": 144, "ct": 447, "alert": "none", "colormode": "ct"}' -scenes['ct']['morning'] = b'{"on": true, "bri": 100, "ct": 447, "alert": "none", "colormode": "ct"}' -scenes['ct']['dimmed'] = b'{"on": true, "bri": 77, "ct": 367, "alert": "none", "colormode": "ct"}' -scenes['ct']['evening'] = b'{"on": true, "bri": 63, "ct": 447, "alert": "none", "colormode": "ct"}' -scenes['ct']['nightlight'] = b'{"on": true, "bri": 1, "ct": 447, "alert": "none", "colormode": "ct"}' -scenes['xt']['bright'] = b'{"on": true, "bri": 254, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.4578, 0.41], "ct": 367, "alert": "none", "colormode": "xy"}' -scenes['xt']['relax'] = b'{"on": true, "bri": 144, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.5019, 0.4152], "ct": 447, "alert": "none", "colormode": "xy"}' -scenes['xt']['morning'] = b'{"on": true, "bri": 100, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.5019, 0.4152], "ct": 447, "alert": "none", "colormode": "xy"}' -scenes['xt']['dimmed'] = b'{"on": true, "bri": 77, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.4578, 0.41], "ct": 367, "alert": "none", "colormode": "xy"}' -scenes['xt']['evening'] = b'{"on": true, "bri": 63, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.5019, 0.4152], "ct": 447, "alert": "none", "colormode": "xy"}' -scenes['xt']['nightlight'] = b'{"on": true, "bri": 1, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.561, 0.4042], "ct": 367, "alert": "none", "colormode": "xy"}' +scenes['ct']['nightlight'] = b'{"on": true, "bri": 1, "ct": 447, "alert": "none"}' +scenes['xy']['nightlight'] = b'{"on": true, "bri": 1, "hue": 8402, "sat": 140, "effect": "none", "xy": [0.561, 0.4042], "ct": 367, "alert": "none"}' def get_state(id): url = f"https://{bridge}/api/{token}/lights/{id}"