namacha / python-magichue

Control Magic Hue(Magichome) in Python.
MIT License
60 stars 12 forks source link

Question: make a bash script and can it control RGB/RGBW LED strips #26

Closed 1liminal1 closed 4 years ago

1liminal1 commented 4 years ago

Hey there,

I'm looking for something that can control my Magic Home LED strips via a bash script so I can set Tautulli to turn off/on the lights when I play a move though Plex.

Would this software be able to do that? and do you have any examples of what a script would look like?

Thanks so much :)

namacha commented 4 years ago

Sorry for the late reply. The answer is “yes”. I don’t know about Tautulli much, but script would like this:

#!/usr/bin/env python
import magichue
import sys

ADDR = ‘change me’
l = magichue.Light(ADDR)

if __name__ == ‘__main__’:
    args = sys.argv
    if args[1] == ‘on’:
        l.on = True

This script will work same as shell script. Don’t forget chmod.

If you have any question, feel free to ask me.

1liminal1 commented 4 years ago

Thanks so much for that 👍 I ended up going a different way :)