08-18-2022, 08:14 PM
(08-18-2022, 05:50 PM)adolfotregosa Wrote:Hi Adolfo,(08-18-2022, 01:24 PM)fdealexa Wrote:(08-18-2022, 11:07 AM)adolfotregosa Wrote: @fdealexa please add this to your tutorial or the touchscreen will not react when you touch it with peppymeter running
[current]
.....
exit.on.touch = False change to exit.on.touch = True
......
Now, your script to start peppymeter needs a tweak, without it the screen does not turn off when you stop/pause the music via web browser. Can you, please make it so that when you pause the music it also stops peppymeter, please ?
Hi Adolfo,
It is my opinion that the tutorial has to be for PeppyMeter as is; then the "Autostart" could be considered as an option, where, of course, the modification of the parameter has to be reported.
With reference to your second request, I will put it in my "to do list".
Thanks and best regards,
Francesco
Hi Francesco, I did the work for you.
File attached:
When you press play I made it wait 4 seconds so moodeaudio has time to wake up screen, when you press pause it stops peppymeter and if you touch the touchscreen while peppymeter is working it will restart on song change and if you press pause it will let the screen turn off since peppymeter is no longer working.
Seams to me a very good compromise until @Tim Curtis integrates peppymeter wink wink, hmmm ??
very good, thanks.
I have made a modification to your code because the status of "pause", in case of radio station is "stop": so I added this lines:
Code:
elif song['state'] == "stop" and prevstat == "ON":
prevstat = "OFF"
subprocess.run(["sudo", "pkill","-f", "peppymeter.py"])
Code:
elif song['state'] == "pause" and prevstat == "ON":
prevstat = "OFF"
subprocess.run(["sudo", "pkill","-f", "peppymeter.py"])
Best regards and thanks,
Francesco