Documentation

Cron Extension

The cron extension works with cron-formatted strings to create time-based triggers for scheduling operations.

Overview

The cron extension works with cron-formatted strings to create time-based triggers. The cron extension is a great way to schedule operations around time.

This extension does not take an extension-level config and is focused on interfaces.

Trigger Interface

Provides a trigger that checks the current time against a cron string.

Option Type Required Description
key String Yes Unique slug id for the component
schedule String Yes Cron string to check time against, e.g. */2 * * * *
name String No Friendly display name of component. Useful for UI.
actions List No List of registered actions to fire.

Config Example

Here is a config of a complete cron trigger.

mudpi.config.json
{
  "trigger": [
    {
      "key": "cron_trigger_1",
      "name": "Every 2 Mins",
      "interface": "cron",
      "schedule": "*/2 * * * *",
      "actions": [".example_toggle.turn_on"]
    }
  ]
}

The configuration above would turn_on an example_toggle every 2 minutes.