Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # pip install soco
- import soco
- import time
- start_time = time.time()
- sonos_zones = list(soco.discover())
- while True:
- time.sleep(0.25 - ((time.time() - start_time) % 0.25))
- for zone in sonos_zones:
- current_volume = zone.volume
- if current_volume > 40:
- print("Current volume is {}, reducing to 25".format(current_volume))
- zone.volume = 25
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement