LUA script repeating like crazy
Posted: Thursday 12 March 2020 18:47
I don't really know how to describe this. I'm trying to make a script that turns on or off the living room lights, based on the sValue of a text device.
The text device is being updated by a Plex webhook. That works fine. So does my script. It just keeps repeating like crazy, where it actually should only run when the text device changes. It's really basic for the moment, but when I can get this behavior fixed I can build on from this. Please help?
This is my script:
The text device is being updated by a Plex webhook. That works fine. So does my script. It just keeps repeating like crazy, where it actually should only run when the text device changes. It's really basic for the moment, but when I can get this behavior fixed I can build on from this. Please help?
This is my script:
Code: Select all
-- Plex verlichting woonkamer
commandArray = {}
if (string.find(otherdevices['Plex-Woonkamer'],'play') or
string.find(otherdevices['Plex-Woonkamer'],'resume'))
then
commandArray['LED-strip-TV']='Off'
else
commandArray['LED-strip-TV']='On'
end
return commandArray