I have a variable that indicates a time in minutes I want to display it as H:M:S. Tried the following script but get an error.
# import the python timedelta class from the datetime module
from datetime import timedelta
# get the variable value
TimeMinutes = indigo.variables[519147712]
#convert to seconds
Seconds = TimeMinutes * 60
# create HH:MM:SS string to set the variable to
h = (Seconds*24)+ Seconds.seconds//3600
m = (Seconds.seconds//60)%60
s = ((newTimeDelta.days*24*60*60) + (Seconds.seconds)) - ((m*60) + (h*60*60))
newValue = "%02i:%02i:%02i" % (h, m, s)
#print to log, if it work i will then set it to a new variable
indigo.server.log (newValue)
This is the error i get
Script Error embedded script: unsupported operand type(s) for *: 'Variable' and 'int'
Script Error Exception Traceback (most recent call shown last):
embedded script, line 8, at top level
TypeError: unsupported operand type(s) for *: 'Variable' and 'int'
so i think my trouble is with converting the the minutes to seconds
Thanks in advance for any help
Elwood