-
-
Save anonymous/eec096db0c89830f75c5 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
plugins: | |
scene: | |
path: 'hueman.plugins.Scene' | |
settings: | |
sunset: | |
orange: | |
quantity: 20% | |
priority: 80 | |
hue: 46789 | |
sat: 150 | |
yellows: | |
quantity: 60% | |
priority: 90 | |
hue: 23133 | |
sat: 200 | |
reds: | |
quantity: 10% | |
priority: 70 | |
hue: 0 | |
sat: 200 |
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
class Scene(object): | |
def __init__(self, **scenes): | |
self.scenes = scenes | |
def __call__(self, controller, scene): | |
try: | |
scene = self.scenes[scene] | |
except KeyError: | |
return | |
n_lights = len(controller) | |
presets = self._do_priority_magic(n_lights, scene) | |
for light, state in zip(controller, presets): | |
light.apply(state) | |
def _do_priority_magic(n, scene): | |
return # TODO |
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
hueman -g office scene:sunset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment