bitfocus / companion-module-malighting-grandma2

grandMA2 support for companion
MIT License
12 stars 8 forks source link

Update grandma2.js #11

Closed who2us closed 1 year ago

who2us commented 1 year ago

updated the case-sensitive false statement for the encoder function, its possible others are affected too,

could you please double-check if these lines are affected as well,

Line 411 - 416 case 'pushbutton': cmd = LUA 'gma.canbus.hardkey("${opt.pushbutton}", true, false)'; break; case 'relbutton': cmd = LUA 'gma.canbus.hardkey("${opt.relbutton}", false, false)'; break;

istnv commented 1 year ago

The actual command should use nil for that parameter, which indicates if the encoder was pressed (true) or released (false). Apparently the click parameter overrides the move option so false causes the command to ignore the movement value. This fix 'works' because LUA is case sensitive and defaults to a nil value if the variable does not exist. Since True and False are not actual keywords and they resolve to nil for that command. This will be fixed in v3.0. There will also be a new press/release option for the encoders.

istnv commented 1 year ago

Obsolete due to V3 refactor/update