first commit
This commit is contained in:
23
dzVents/examples/only run script when button pressed.lua
Normal file
23
dzVents/examples/only run script when button pressed.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
return {
|
||||
|
||||
-- create a function for the active key, when the switch in Domoticz
|
||||
-- called 'script_blabla' is active, then the script is executed.
|
||||
|
||||
-- Note: keep this function really light weight because it is ALWAYS
|
||||
-- executed in every cycle, even when 'My switch' hasn't changed!!
|
||||
|
||||
active = function(domoticz)
|
||||
return (domoticz.devices('script_blabla').state == 'On')
|
||||
end,
|
||||
|
||||
on = {
|
||||
devices = {
|
||||
'My switch'
|
||||
}
|
||||
},
|
||||
|
||||
execute = function(domoticz, mySwitch)
|
||||
-- do some weird complicated stuff
|
||||
-- that takes quite some processing time ;-)
|
||||
end
|
||||
}
|
||||
Reference in New Issue
Block a user