Kommer lista lite funktioner här:
Skicka push meddelande
Code: Select all
-- function push message to mobile
local activatePush = true;
local ID_Smartphone = 141;
pushMessage = function (sendPush)
if (activatePush) then
fibaro:call(ID_Smartphone, 'sendPush', sendPush);
end
end
Code: Select all
pushMessage("Test of push message")
Man kan ändra färg på debug kod (kanske inte är så flashigt om man är färgblind)
Code: Select all
-- debug function
Debug = function ( color, message )
fibaro:debug(string.format('<%s style="color:%s;">%s</%s>', "span", color, message, "span"));
end
Code: Select all
Debug("red","Test message")
Debug("green","Test message")
Debug("orange","Test message")
Mer färgad debug text
Code: Select all
-- Show debuginfo true/false
local showStandardDebugInfo = true;
local showExtraDebugInfo = true;
-- the functions
ExtraDebug = function (debugMessage)
if ( showExtraDebugInfo ) then
Debug( "grey", debugMessage);
end
end
StandardDebug = function (debugMessage)
if ( showStandardDebugInfo ) then
Debug( "white", debugMessage);
end
end
Code: Select all
ExtraDebug( "Test message, grey color" );
StandardDebug( "Test message, white color" );
Code: Select all
-- function send email
local activateMail = true;
sendMail = function (subject, sendMail)
if (activateMail) then
fibaro:call(4, 'sendEmail', subject, sendMail);
end
end
Code: Select all
sendMail("Subject", "Test of mail message")