Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- %% properties
- %% events
- 614 CentralSceneEvent
- %% globals
- --]]
- function call_action1()
- if (fibaro:getGlobal('PresentState') == 'Home') then
- fibaro:debug('Jemand zu Hause. Öffne Tür.')
- fibaro:call(531, "unsecure")
- end
- end
- function call_action2()
- end
- function call_action3()
- end
- function call_action4()
- end
- function call_action5()
- end
- function call_action6()
- end
- Debug = function ( color, message )
- fibaro:debug(string.format('<%s style="color:%s;">%s', "span", color, message, "span"))
- end
- fibaro:debug('Fibaro KeyFob - Szene gestartet...')
- Debug( 'green', '- siio.de - Dein Smart Home Blog -')
- local swipe_source = fibaro:getSourceTrigger()["event"]["data"] --Obtain data about the event
- --fibaro:debug("Key " .. swipe_source["keyId"] .. " Attr " .. swipe_source["keyAttribute"])
- if (swipe_source["keyId"] == 1 and swipe_source["keyAttribute"] == 'Pressed') then
- fibaro:debug('Taste 1 gedrückt')
- call_action1()
- elseif (swipe_source["keyId"] == 2 and swipe_source["keyAttribute"] == 'Pressed') then
- fibaro:debug('Taste 2 gedrückt')
- call_action2()
- elseif (swipe_source["keyId"] == 3 and swipe_source["keyAttribute"] == 'Pressed') then
- fibaro:debug('Taste 3 gedrückt')
- call_action3()
- elseif (swipe_source["keyId"] == 4 and swipe_source["keyAttribute"] == 'Pressed') then
- fibaro:debug('Taste 4 gedrückt')
- call_action4()
- elseif (swipe_source["keyId"] == 5 and swipe_source["keyAttribute"] == 'Pressed') then
- fibaro:debug('Taste 5 gedrückt')
- call_action5()
- elseif (swipe_source["keyId"] == 6 and swipe_source["keyAttribute"] == 'Pressed') then
- fibaro:debug('Taste 6 gedrückt')
- call_action6()
- end
- --[[
- while (swipe_source["keyId"] == 1 and swipe_source["keyAttribute"] == 'HeldDown') do
- fibaro:debug('WallMote Taste 1 gedrückt gehalten')
- fibaro:sleep(2*1000)
- end
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement