Read the statement by Michael Teeuw here.
MMM-OneButton one button two defineable actions
-
This is my first working module. I wanted to make one button do more than one thing. This module uses a python script to poll the button state. The button can be pressed and released or it can be held down for a long period of approx 4 seconds.
I am currently using MMM-OneButton with the MMM-Pages module to PAGE_INCREMENT the pages upon a button press.
And to ARTICLE_NEXT for the default news module when the button is held.I have to give Sam kudo for all his examples he has posted on this forum. He’s really helped me a lot.
I plan on making it even more useful by adding in the obligatory screen on/off. reboot pi, etc. But I am excited that I’m finally figuring this stuff out enough to actually make a working module.
If you want to try it out and give me some feedback, it’s located at
https://github.com/Kayakbabe/MMM-OneButton -
@kayakbabe I’ll have to play with this - my current solution is pure python and calling things with REST webcalls and such.
-
@BKeyport If you want to spin your own, take a look at Sams MMM-PythonPrint example he has posted in these forums. It can run any python script with little tweaking. It sure helped me get off the ground with this.
I’m going to flesh my OneButtons out to do many actions with just one button (or many actions with several buttons) and add the tv cec or lcd commands to sleep and wake up. And shutdown and Reboot. It can send any notification that is useful to the Mirror or modules running. I am thinking of having it do something fun like if double clicked fast… pop up a screaming halloween face… My brother likes to try to “Break” thinks. I want to give him a surprise.
I think it’s possible to do one button with maybe 6 or seven different actions. I’ve got four working so far and when I get it where I think it’s stable, I’ll put it out on git hub for some feedback.