fibaro:countScenes()
fibaro:countScenes(sceneID)
-- Displays the number of instances of the current scene
local
num =
fibaro:countScenes
()
if
(num == 1)
then
fibaro:debug
(
'I am running only once.'
)
else
fibaro:debug
(
'I am running '
.. num ..
' times.'
)
end
-- Only allow one instance of the current scene to run at a time
if
(
fibaro:countScenes
() > 1)
then
fibaro:abort
()
end
-- Displays number of instances of scene 12
num =
fibaro:countScenes
(12);
fibaro:debug
(
'Number of instances of scene 12: '
.. num);
-- Check if scene 12 is running
if
(
fibaro:countScenes
(12) >= 1)
then
fibaro:debug
(
'Scene 12 is running'
);
else
fibaro:debug
(
'Scene 12 is not running'
);
end
fibaro:startScene
fibaro:killScenes