Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: Play Indicator
#1
I have moved to the point of not using my display. It is too difficult to read and say anything useful that can be seen from my listening position. I primarily use my Ipad or phone to select tunes, but have programed my IR remote (which also controls my preamp) to stop, start play, pause and select favorite radio stations from Moode. I am not always tied to a network device but I did want some indication of whether the PI was doing anything. First I added a GPIO LED. That worked great, but I had a better idea with the built in LED's. See Python script below:
*******************************************
import os
import subprocess
import time

os.system("sudo sh -c 'echo none > /sys/class/leds/led0/trigger'")
os.system("sudo sh -c 'echo none > /sys/class/leds/led1/trigger'")

os.system("sudo sh -c 'echo 0 > /sys/class/leds/led1/brightness'")
os.system("sudo sh -c 'echo 1 > /sys/class/leds/led0/brightness'")
while True:
output = subprocess.getoutput(["mpc -w status"])
if "[playing]" in output:

os.system("sudo sh -c 'echo 0 > /sys/class/leds/led0/brightness'")
os.system("sudo sh -c 'echo 1 > /sys/class/leds/led1/brightness'")

os.system("mpc -q -w idle")
# print("Playing")
else:
if "[paused]" in output:
os.system("sudo sh -c 'echo 0 > /sys/class/leds/led1/brightness'")
time.sleep(0.9)
os.system("sudo sh -c 'echo 1 > /sys/class/leds/led0/brightness'")
time.sleep(0.05)
os.system("sudo sh -c 'echo 0 > /sys/class/leds/led0/brightness'")
# print("paused")
else:
os.system("sudo sh -c 'echo 0 > /sys/class/leds/led1/brightness'")
os.system("sudo sh -c 'echo 1 > /sys/class/leds/led0/brightness'")
os.system("mpc -q -w idle")
# print("stopped")


*******************************************
Note that I could not get tabs to be added in proper places or attach as a proper python file.

Play is red, Stop is green, Pause is flashing green. Maybe something similar can be added in the future.
I really love Moode and look forward to version 7.0
-Tom
Reply


Forum Jump: