shelly-tools / shelly-script-examples

Shelly mJS Scripting examples
GNU Affero General Public License v3.0
72 stars 21 forks source link

Update emulate_shutter_cycleswitch.js #8

Closed sebibrunner closed 1 year ago

sebibrunner commented 2 years ago

Single push didn't got thrown on a shell pro i4 which got changed from switch to button. Fix to listening to all "pushed" events.

sebibrunner commented 2 years ago

Feel free to update code syntax. This one worked for me :)

eurich commented 2 years ago

What's the Shelly firmware you're testing with? Maybe you encountered a bug? From my experience it's working fine with single_push and Shelly Plus I4 with connected push buttons.

Not sure it's a good idea using "btn_up" and "btn_down" events as they are also fired on double and longpush events, so those can't be used anynome.

I'll do some testing.