I'm stumped! I'm still in the process of converting AppleScripts to Python. These lines worked in AppleScript but are failing when converted to Python. I have to use a variable name rather than an ID because I need to calculate the Indigo variable's name.
Here's the code that fails:
- Code: Select all
StepNumber = "1" # Temp overide
WateringDayCountVarName = "WateringDaysBetweenCounterLawnZone" + StepNumber # Assign WateringDayCountVarName to Name of Indigo's Watering Days Counter variable
WateringDaysBetweenCounterZoneX = indigo.variables["WateringDayCountVarName"].value
indigo.server.log (WateringDaysBetweenCounterZoneX)
Here is the error message:
Script Error Watering Next Step Triggered.py: 'key name WateringDayCountVarName not found in database'
Script Error Exception Traceback (most recent call shown last):
Watering Next Step Triggered.py, line 8, at top level
KeyError: 'key name WateringDayCountVarName not found in database'
Thanks for any help you can provide,
Mike