Try this. I've added lots of comments and separated out each step into it's own line to illustrate the individual steps. Consider it a learning script:
- Code: Select all
# Get the high temp value from the Indigo variable (all variable values are returned as strings)
high_temp = indigo.variables[ID_OF_WUHighTemp].value
# Get the low temp value from the Indigo variable (all variable values are returned as strings)
low_temp = indigo.variables[ID_OF_WULowTemp].value
# Get the forecast value from the Indigo variable (all variable values are returned as strings)
forecast = indigo.variables[ID_OF_WUForecast].value
# Create the combined string - notice the embedded degree symbols, they work great
# The open/close bracket notation means that it's going to have a value substituted there
# so the first one will get forecast, the second one high_temp, and the last low_temp. The
# resulting string is something like:
# Very hot and dry. 103°/75°
combined_forecast = u"{} {}°/{}°".format(forecast, high_temp, low_temp)
# Set the value of the WUForecastAll variable to the combined_forecast string
# just created.
indigo.variable.updateValue(ID_OF_WUForecastAll, value=combined_forecast)
In future scripts, feel free to delete the comment lines (starting with the # sign). Again, I highly recommend doing a Python tutorial, it won't take very long and you'll gain a ton of understanding from doing it.