-
-
Save delfick/0147de1cdc9a625bbb9d5b967e2b9840 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from photons_app.executor import library_setup | |
from photons_messages import DeviceMessages | |
from photons_colour import Parser | |
collector = library_setup() | |
lan_target = collector.configuration['target_register'].resolve("lan") | |
async def doit(): | |
on_msg = DeviceMessages.SetPower(level=65535, res_required=False) | |
first_brightness = Parser.color_to_msg("brightness:1", overrides={"duration": 0, "res_required": False}) | |
blink = Parser.color_to_msg("brightness:0" | |
, overrides = { | |
"effect": "sine" | |
, "cycles": 15 | |
, "period": 1 | |
, "skew_ratio": 0.5 | |
, "res_required": False | |
} | |
) | |
script = lan_target.script([first_brightness, on_msg, blink]) | |
# You'd of course get the serial from the commandline | |
# and/or use a special reference: | |
# https://delfick.github.io/photons-core/photons_app/special.html#photons-app-special | |
await script.run_with_all("d073d5229322") | |
loop = collector.configuration["photons_app"].loop | |
loop.run_until_complete(doit()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment