Fixing a script that used to work
Posted: Sun May 19, 2024 1:05 pm
I have a wee python script that I'm sure used to work, but for whatever reason sometime in the last decade or so it's stopped working and for the life of me I can't work out why.
It's supposed to take the value of how many times Sushi has been fed, convert it to a string, then add it into a string of text that reads 'Fed 1 time, Last feed at 17:47" or whatever the values for that were at the time.
The script is this:
However this is what ends up in the variable:
I'm a bit lost as to where this is all coming from. I've been rather absent from this stuff for a good few years so my memory of how it all worked is hazy to say the least, and I know in that time we've had a fair few Python upgrades so I'm not sure if that has something to do with it.
Any ideas?
It's supposed to take the value of how many times Sushi has been fed, convert it to a string, then add it into a string of text that reads 'Fed 1 time, Last feed at 17:47" or whatever the values for that were at the time.
The script is this:
Code: Select all
curTime = indigo.server.getTime().time()
curTimeStr = "\n" + str(curTime)
sushi_fed_number = indigo.variables[151546714] # "cat_sushi_fed_number"
sushi_fed_number_str = "\n" + str(sushi_fed_number)
sushi_fed = indigo.variables[1274955679] # "cat_sushi_fed"
fed_str = u"Fed %s time, Last feed at %s" % (sushi_fed_number, curTimeStr)
indigo.variable.updateValue(sushi_fed, fed_str)
Code: Select all
Fed description :
folderId : 1345505049
globalProps : MetaProps : (dict)
com.indigodomo.indigoserver : (dict)
emptyDict : (dict)
id : 151546714
name : cat_sushi_fed_number
pluginProps : emptyDict : (dict)
readOnly : False
remoteDisplay : True
sharedProps : com.indigodomo.indigoserver : (dict)
value : 1 time, Last feed at
19:59:30.194000
Any ideas?