Outputs: positions (a key steps off → a → b → off, a knob up and down, the last off before the next on), strobe (a period) and dimmer (a knob's level by a step; a dimmable module gets a byte per channel, a relay just switches); in /keypad.html and /sim.html, a key's LED on while a position is chosen or a strobe runs
This commit is contained in:
1 parent
e82b2236b5
commit
82a728e024
7 files changed
+239
-55
No files matched your search
@@ -206,6 +206,10 @@ class AppTest < Minitest::Test
|
||||
assert_equal body["bindings"], Maptool::App.bindings
|
||||
assert_equal 400, request.put("/api/keypad/bindings", input: JSON.generate(bindings: [{ "input" => "pad.K1", "mode" => "blink" }]), **logged_in_env).status
|
||||
assert_equal 400, request.put("/api/keypad/bindings", input: JSON.generate(bindings: [{ "input" => "pad.K1", "led" => "pink" }]), **logged_in_env).status
|
||||
assert_equal 400, request.put("/api/keypad/bindings", input: JSON.generate(bindings: [{ "input" => "pad.K2", "mode" => "positions", "output" => "relays.1" }]), **logged_in_env).status
|
||||
pos = [{ "input" => "pad.K2", "mode" => "positions", "outputs" => ["relays.1", "relays.2"], "output" => "relays.1" }]
|
||||
assert_equal [{ "input" => "pad.K2", "mode" => "positions", "outputs" => ["relays.1", "relays.2"] }],
|
||||
json_body(request.put("/api/keypad/bindings", input: JSON.generate(bindings: pos), **logged_in_env))["bindings"]
|
||||
refute json_body(request.delete("/api/keypad/bindings", **logged_in_env))["saved"]
|
||||
assert Maptool::App.bindings.size > 1
|
||||
ensure
|
||||
|
||||
Reference in new issue
Block a user