Created
November 6, 2017 21:07
-
-
Save tanepiper/a0aaf7160177688cfaaaf061b7df1d22 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const register = shared => ({ | |
| event: 'HeatWarning', | |
| command: async event => { | |
| const lights = await shared.hub.lights.getAll(); | |
| lights.map(async (light, index) => { | |
| light.on = true; | |
| light.alert = 'lselect'; | |
| light.effect = 'none'; | |
| light.brightness = 254; | |
| light.saturation = 254; | |
| if (index % 2 === 0) { | |
| light.xy = shared.h.rgbToXy(shared.h.colours.RED); | |
| } else { | |
| light.xy = shared.h.rgbToXy(shared.h.colours.YELLOW); | |
| } | |
| await shared.hub.lights.save(light); | |
| await shared.h.sleep(5000); | |
| await shared.h.setLightToCurrentStar(); | |
| }); | |
| } | |
| }); | |
| module.exports = register; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment