{
  "pluginAlias": "Oto",
  "pluginType": "platform",
  "singular": true,
  "headerDisplay": "OTO has no official API. The **cloud** transport authenticates with your OTO account and talks to OTO's Google Cloud backend. The **local** transport talks to a device running the community `irrigoto` ESPHome firmware. See docs/OTO_API.md.",
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "title": "Name",
        "type": "string",
        "default": "Oto",
        "description": "Platform name shown in logs."
      },
      "transport": {
        "title": "Transport",
        "type": "string",
        "default": "cloud",
        "oneOf": [
          { "title": "Cloud (OTO cloud backend)", "enum": ["cloud"] },
          { "title": "Local (irrigoto ESPHome firmware)", "enum": ["local"] }
        ],
        "description": "Which backend to use."
      },
      "email": {
        "title": "OTO Account Email",
        "type": "string",
        "description": "Your OTO app login email (cloud transport).",
        "condition": { "functionBody": "return model.transport !== 'local';" }
      },
      "password": {
        "title": "OTO Account Password",
        "type": "string",
        "description": "Your OTO app password (cloud transport).",
        "condition": { "functionBody": "return model.transport !== 'local';" }
      },
      "wateringQuantity": {
        "title": "Watering Amount (mm)",
        "type": "number",
        "default": 12.7,
        "minimum": 1,
        "maximum": 50,
        "description": "Default watering DEPTH in millimetres for 'Water Now'. OTO converts this to a runtime using each zone's precipitation rate (it is a depth, not a duration). The OTO app uses ~31.75 mm (1.25\") for a deep soak.",
        "condition": { "functionBody": "return model.transport !== 'local';" }
      },
      "wateringQuantities": {
        "title": "Per-Zone Watering Amounts (mm)",
        "type": "object",
        "description": "Optional per-zone override of the watering amount, keyed by zoneId, e.g. { \"FhFU1lfRN3IhyxPX\": 25.4 }.",
        "additionalProperties": { "type": "number" },
        "condition": { "functionBody": "return model.transport !== 'local';" }
      },
      "localDevices": {
        "title": "Local Devices",
        "type": "array",
        "items": { "type": "string", "title": "Hostname or IP" },
        "description": "irrigoto device hostnames/IPs, e.g. irrigoto-ab12cd.local (local transport).",
        "condition": { "functionBody": "return model.transport === 'local';" }
      },
      "updateInterval": {
        "title": "Update Interval (seconds)",
        "type": "integer",
        "default": 30,
        "minimum": 10,
        "maximum": 600,
        "description": "How often to refresh device status."
      }
    }
  }
}
