Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
indigo_2025.1_documentation:schedule_class [2026/02/19 02:33] – [Class Properties] davel17indigo_2025.1_documentation:schedule_class [2026/02/19 21:11] (current) – [Schedule Base Class] davel17
Line 7: Line 7:
 Like other high-level objects in Indigo, there are rules for modifying schedules. For Scripters and Plugin Developers: Like other high-level objects in Indigo, there are rules for modifying schedules. For Scripters and Plugin Developers:
  
-  - To create, duplicate, delete, and send commands to a schedule, use the command namespace as described below +  - To duplicate, delete, and send commands to a schedule, use the command namespace as described below 
-  - To modify an object's definition, get a copy of the schedule, make the necessary changes, then call //''mySchedule.replaceOnServer(newPropsDict)''// +  - To modify an object's definition, get a copy of the schedule, make the necessary changes, then call //''mySchedule.replaceSharedPropsOnServer(newPropsDict)''// (see below).
- +
-For Plugin Developers: +
- +
-  - To update a plugin's props on a schedule, call //''mySchedule.replacePluginPropsOnServer(newPropsDict)''// rather than try to update them on the local schedule +
- +
-Unlike [[device_class|Devices]], you can't call //''create()''// in the the schedule base class command namespace (//''indigo.schedule.*''//). Rather, each subclass has its own //''create()''// method that takes the appropriate arguments for that schedule type.+
  
 ==== Class Properties ==== ==== Class Properties ====
Line 21: Line 15:
  
 ^ Property ^ Type ^ Writable ^ Description ^ ^ Property ^ Type ^ Writable ^ Description ^
-| //''absoluteDate''// | datetime.datetime / None | | | +| //''absoluteDate''// | datetime.datetime / None | Yes The absolute date of the next schedule execution with 00:00:00 as the base time. 
-| //''absoluteDateTime''// | datetime.datetime / None | | | +| //''absoluteDateTime''// | datetime.datetime / None | Yes The absolute date and time of the next schedule execution. 
-| //''absoluteTime''// | datetime.datetime / None | | | +| //''absoluteTime''// | datetime.datetime / None | Yes The absolute time of the next schedule execution with 2000-01-01 as the base date. 
-| //''autoDelete''// | boolean | Yes | true if Indigo should automatically delete this schedule after the next execution, otherwise false | +| //''autoDelete''// | boolean | Yes | true if Indigo should automatically delete this schedule after the next execution, otherwise false
-| //''configured''// | boolean | Yes | true if the schedule has been fully configured, otherwise false | +| //''configured''// | boolean | Yes | true if the schedule has been fully configured, otherwise false
-| //''dateType''// | indigo.kDateType / None | | | +| //''dateType''// | indigo.kDateType / None |  Describes the "type" of date/time options for the schedule. [Absolute / EveryDay / DaysOfWeek / DaysOfMonth]
-| //''description''// | string | Yes | description of the schedule | +| //''description''// | string | Yes | description of the schedule
-| //''enabled''// | boolean | Yes | true if the schedule is enabled, otherwise false (Indigo will not execute the schedule if false | +| //''enabled''// | boolean | Yes | true if the schedule is enabled, otherwise false (Indigo will not execute the schedule if false). 
-| //''folderId''// | integer | No | unique ID of the folder this schedule is in | +| //''folderId''// | integer | No | unique ID of the folder this schedule is in
-| //''globalProps''// | dictionary | No | | +| //''globalProps''// | dictionary | No | an //''indigo.Dict()''// that will contain the props for the schedule. It's generally easier to use the shortcut //''sharedProps''// below. 
-| //''id''// | integer | No | a unique id of the schedule, assigned on creation by IndigoServer | +| //''id''// | integer | No | a unique id of the schedule, assigned on creation by IndigoServer
-| //''name''// | string | Yes | the unique name of the schedule - no two schedules can have the same name | +| //''name''// | string | Yes | the unique name of the schedule - no two schedules can have the same name
-| //''nextExecution''// | datetime.datetime / None | No | The date and time of the schedule's next execution | +| //''nextExecution''// | datetime.datetime / None | No | The date and time of the schedule's next execution
-| //''pluginProps''// | dictionary | No | |+| //''pluginProps''// | dictionary | No | pluginProps will return an empty dict because plugins cannot currently create custom schedules. |
 | //''randomizeBy''// | integer | Yes | the number of minutes (plus or minus) Indigo should use to randomize the execution of the schedule. | | //''randomizeBy''// | integer | Yes | the number of minutes (plus or minus) Indigo should use to randomize the execution of the schedule. |
-| //''remoteDisplay''// | boolean | Yes | true if remote clients should display the schedule, otherwise false (does not affect the Indigo client UI | +| //''remoteDisplay''// | boolean | Yes | true if remote clients should display the schedule, otherwise false (does not affect the Indigo client UI
-| //''sharedProps''// | dictionary | No | | +| //''sharedProps''// | dictionary | No | an //''indigo.Dict()''// containing the name/value pairs that are shared by all plugins. This is the property dictionary that you can edit via the Global Properties plugin, and your plugin may manage properties in this dictionary as well to add metadata to devices that your plugin can use for other purposes. Use //''sched.replaceSharedPropsOnServer()''// to update them (as with pluginProps, you should get copy first, update the copy, then set them back to that copy so you don't accidentally remove some other plugin's props). 
-| //''sunDelta''// | integer | | | +| //''sunDelta''// | integer | Yes The number of seconds before (negative) or after (positive) sunrise or sunset when the schedule should be executed (zero if no offset). 
-| //''suppressLogging''// | boolean | Yes | true if Indigo should skip logging the schedule's execution in the event log, otherwise false | +| //''suppressLogging''// | boolean | Yes | true if Indigo should skip logging the schedule's execution in the event log, otherwise false
-| //''timeType''// | indigo.kTimeType | | | +| //''timeType''// | indigo.kTimeType | Yes Absolute / Sunrise / Sunset / Countdown depending on the date and time options selected. 
-| //''upload''// | boolean | Yes | true if IndigoServer should attempt to upload this schedule to the interface |+| //''upload''// | boolean | Yes | true if IndigoServer should attempt to upload this schedule to the interface|
  
 ==== Commands (indigo.schedule.*) ==== ==== Commands (indigo.schedule.*) ====
Line 94: Line 88:
 |direct parameter|  Yes  |  integer  |id or instance of the schedule to execute| |direct parameter|  Yes  |  integer  |id or instance of the schedule to execute|
 |''//ignoreConditions//'' No  |  bool  |True will execute the schedule regardless of the conditions set within the schedule, False will honor them| |''//ignoreConditions//'' No  |  bool  |True will execute the schedule regardless of the conditions set within the schedule, False will honor them|
-|''//schedule_data//'' No  |  object data to be passed to the schedule before it is executed |+|''//schedule_data//'' No  |  object an ''//indigo.Dict//'' to be passed to the schedule before it is executed | 
 + 
 +A note on ''schedule_data'' - Indigo will automatically add a ''source'' key to your dictionary to represent where the action execution came from: 
 + 
 +  * "server" if it's something generated from the server itself (schedule execution, built-in trigger, etc) 
 +  * "python" if it's something that comes through IPH that doesn't already have a source attached (scripts, plugins) 
 +  * "api-http" if it came from the HTTP API and there wasn't already an included "source" 
 +  * "api-websocket" if it came from the websocket API and there wasn't already an included "source" 
 + 
 +However, if you include a ''source'' key in your ''schedule_data'', we will not overwrite it, we'll just pass through whatever your value is. 
 + 
 +For example, if you  
 + 
 +<code> 
 +my_dict = indigo.Dict() 
 +my_dict["foo"] = "bar" 
 +indigo.schedule.execute(324976872, schedule_data=my_dict) 
 +</code> 
 +The schedule you executed will receive something like this: 
 +<code> 
 +{"event-indigo-id": 324976872, "event-type": "Schedule", "foo": "bar", "source": "python", "timestamp": "1970-01-01T09:09:40"
 +</code>
  
 === Get Dependencies === === Get Dependencies ===
Line 121: Line 136:
 |value|  Yes  |  int | string  |id or instance of the schedule| |value|  Yes  |  int | string  |id or instance of the schedule|
  
-=== Move to Folder ===+=== Remove Delayed Actions ===
  
 Remove any outstanding delayed actions from the specified schedule. Remove any outstanding delayed actions from the specified schedule.
  • /www/perceptive/wiki/data/attic/indigo_2025.1_documentation/schedule_class.1771468402.txt.gz
  • Last modified: 2026/02/19 02:33
  • by davel17