{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "description": "DLite schedule definition",
  "type": "object",
  "required": [ "lampmapping", "schedule" ],
  "properties": {
    "comment": {
      "type": "string",
      "description": "Info about this schedule definition"
    },
    "lampmapping": {
      "type": "array",
      "description": "Mapping of LEDs to an array index",
      "items": {
        "type": "string",
        "description": "LED/Lamp name, used as an identifier"
      }
    },
    "mrclock": {
      "type": "string",
      "description": "Name of a MR-Clock fastclock"
    },
    "clock_starttime": {
      "$ref": "#time",
      "description": "After boot, at which  clock should this animate start"
    },
    "clock_speed": { "type": "number", "description": "Real time seconds for every model minute" },
    "schedule": {
      "type": "array",
      "description": "The schedule definition as an array of schedule items"
    },
    "definitions" {
      "time": {
        "$id": "#time",
        "type": "object",
        "properties": {
          "h": { "type": "number", "description": "0..23 = Hour of day" },
          "m": { "type": "number", "description": "0..59 = Minutes of hour" }
        }
      },
      "schedule_item": {
        "$id": "#schedule_item",
        "type": "object",
        "properties": {
          "time": {
            "$ref": "#time",
            "description": "Start time, when this schedule item should fire"
          },
          "lamp": {
            "type": "string",
            "description": "Name of the LED/lamp, this item should apply to -- corresponds to lampmapping"
          },
          "color": {
            "type": "string",
            "description": "Name of the color to be shown; corresponds to color name in color definitions."
          },
          "mode": {
            "type": "string",
            "description": "Dynamic behaviour / mode; allowed values are: OnOff"
          },
        }
      }
    }
  }
}

