My bad, I forgot the correct syntax for getting an integer value from a variable. I don't actually use variables all that much.
Not that you didn't change both instances of
wind_dir_last in each if test line.
- Code: Select all
wind_number = indigo.variables[1332247332].getValue(int) # "Wind_Dir_Number"
wind_text = indigo.variables[543848099] # "Wind_Dir_Text"
if wind_number > 338 or wind_number < 22:
dir = "North"
elif wind_number > 22 and wind_number < 67:
dir = "Northeast"
elif wind_number > 67 and wind_number < 112:
dir = "East"
elif wind_number > 112 and wind_number < 157:
dir = "Southeast"
elif wind_number > 157 and wind_number < 202:
dir = "South"
elif wind_number > 202 and wind_number < 247:
dir = "Southwest"
elif wind_number > 247 and wind_number < 292:
dir = "West"
elif wind_number > 292 and wind_number < 338:
dir = "Northwest"
indigo.variable.updateValue(wind_text, dir)
Also, the actual error was:
- Code: Select all
AttributeError: 'Variable' object has no attribute 'intValue'
which is not the same as:
'Variable object has no attribute "IntValue"