skip custom hardware ids
This commit is contained in:
1 parent
62f30f9285
commit
a54ef74ff5
3 files changed
+29
-31
No files matched your search
@@ -10,19 +10,16 @@ end
|
||||
|
||||
-- add button with one event (press)
|
||||
function assign(buttonName, config)
|
||||
local defaultHardwareId = arduino .. config.pin
|
||||
hw_id = user_prop_add_hardware_id("Button " .. tostring(buttonName), defaultHardwareId, tostring(buttonName))
|
||||
hw_button_add(tostring(hw_id), function()
|
||||
local buttonNameWithPin = config.name .. " (Default Pin: " .. config.pin .. ")"
|
||||
hw_button_add(buttonNameWithPin, function()
|
||||
event(config.event)
|
||||
end)
|
||||
end
|
||||
|
||||
-- add button with two events (press/release)
|
||||
function assignClr(buttonName, config)
|
||||
local defaultHardwareId = arduino .. config.pin
|
||||
hw_id = user_prop_add_hardware_id("Button " .. tostring(buttonName), defaultHardwareId, tostring(buttonName))
|
||||
|
||||
hw_button_add(tostring(hw_id), function()
|
||||
local buttonNameWithPin = config.name .. " (Default Pin: " .. config.pin .. ")"
|
||||
hw_button_add(buttonNameWithPin, function()
|
||||
timer_clear = timer_start(2000, function()
|
||||
event(config.event2)
|
||||
end)
|
||||
|
||||
Reference in new issue
Block a user