# indigo.variables[1980497029] # "isHoliday"
# indigo.variables[1479852422] # "whatHoliday"
from datetime import date
import holidays
indigo.variable.updateValue(1980497029, value="False")
indigo.variable.updateValue(1479852422, value="None")
us_holidays = holidays.UnitedStates() # or holidays.US()
if date.today() in us_holidays:
indigo.variable.updateValue(1980497029, value="True")
indigo.variable.updateValue(1479852422, us_holidays.get(date.today()))
from datetime import date
# contains a list of all the school holidays
holiday_list = indigo.variables[1939762834].value
today = date.today().strftime('%Y-%m-%d')
a = today in holiday_list
indigo.variable.updateValue(27794980, value=str(a)) # "isSchoolClosed"
jalves wrote:Post #4 has my complete script for setting the variable.So, running that script at 12:01, would you then set a variable to true if it's a holiday? And then use that variable when performing actions, or not performing actions, based on the state of the variable?
Users browsing this forum: No registered users and 1 guest