That’s it. Much simpler. I created a Mac Automator app that runs this script on login.
#!/bin/bash trigger=0 while true; do ps -ef | grep T33_64UMC_40.11.5.11 | grep -v grep | grep -v standby > /dev/null result=$? if [ $result -eq 0 ] && [ $trigger -eq 0 ] then # echo "WebEx in Progress…" python3 "/Users/faucherd/pywizlight/red.py" trigger=1 elif [ $result -eq 1 ] && [ $trigger -eq 1 ] then # echo "WebEx Ended..." python3 "/Users/faucherd/pywizlight/warmwhite.py" trigger=0 fi sleep 5 done
#!/bin/bash trigger=0 while true; do ps -ef | grep CptHost | grep -v grep > /dev/null result=$? if [ $result -eq 0 ] && [ $trigger -eq 0 ] then # echo "Zoom in Progress…" python3 "/Users/faucherd/pywizlight/red.py" trigger=1 elif [ $result -eq 1 ] && [ $trigger -eq 1 ] then # echo "Zoom Ended..." python3 "/Users/faucherd/pywizlight/warmwhite.py" trigger=0 fi sleep 5 done
import asyncio from pywizlight.bulb import wizlight, PilotBuilder, discovery async def main(): # Set up a standard light light = wizlight("192.168.86.37") # Set bulb brightness (with async timeout) timeout = 10 await asyncio.wait_for(light.turn_on(PilotBuilder(brightness = 255)), timeout) # Set RGB values # red to 0 = 0%, green to 128 = 50%, blue to 255 = 100% await light.turn_on(PilotBuilder(rgb = (255, 0, 0))) loop = asyncio.get_event_loop() loop.run_until_complete(main())
import asyncio from pywizlight.bulb import wizlight, PilotBuilder, discovery async def main(): # Set up a standard light light = wizlight("192.168.86.37") # Set bulb brightness (with async timeout) timeout = 10 await asyncio.wait_for(light.turn_on(PilotBuilder(brightness = 255)), timeout) # Set bulb to warm white await light.turn_on(PilotBuilder(warm_white = 255)) loop = asyncio.get_event_loop() loop.run_until_complete(main())