{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rachio/json-schema/rachio-list-valves-response-schema.json",
  "title": "ListValvesResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rachio-valveservice-api-openapi.yml#/components/schemas/ListValvesResponse",
  "type": "object",
  "properties": {
    "valves": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Valve"
      }
    }
  },
  "$defs": {
    "Photo": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "default": {
          "description": "true if this is actually the default valve photo",
          "type": "boolean"
        }
      }
    },
    "Valve": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "connectionId": {
          "description": "internal ID to identify the valve and base station bond",
          "type": "string"
        },
        "photo": {
          "$ref": "#/$defs/Photo"
        },
        "state": {
          "$ref": "#/$defs/ValveState"
        },
        "color": {
          "enum": [
            "LIGHT_BLUE",
            "PURPLE",
            "GREEN",
            "ORANGE",
            "TEAL",
            "YELLOW",
            "BLUE",
            "PINK"
          ],
          "type": "string",
          "format": "enum"
        },
        "detectFlow": {
          "type": "boolean"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "updated": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "ValveDesiredState": {
      "type": "object",
      "description": "The desired values for the valve to sync",
      "properties": {
        "defaultRuntimeSeconds": {
          "type": "integer",
          "format": "int64"
        },
        "calendarHash": {
          "description": "An internal representation of the valve calendar data. This changes when programs or skips are adjusted",
          "type": "string"
        }
      }
    },
    "ValveReportedState": {
      "type": "object",
      "description": "The current state of the valve",
      "properties": {
        "connected": {
          "type": "boolean"
        },
        "defaultRuntimeSeconds": {
          "type": "integer",
          "format": "int64"
        },
        "lastWateringAction": {
          "description": "This field is present if the valve is open / watering",
          "$ref": "#/$defs/WateringAction"
        },
        "lastSeen": {
          "type": "string",
          "format": "date-time"
        },
        "batteryStatus": {
          "enum": [
            "GOOD",
            "REPLACE",
            "LOW",
            "UNKNOWN"
          ],
          "type": "string",
          "format": "enum"
        },
        "firmwareVersion": {
          "type": "string"
        },
        "calendarHash": {
          "description": "An internal representation of the valve calendar data. This changes when programs or skips are adjusted",
          "type": "string"
        }
      }
    },
    "ValveState": {
      "type": "object",
      "description": "Valves are async devices. The state contains the desired changes as well as then current state of the device.",
      "properties": {
        "reportedState": {
          "$ref": "#/$defs/ValveReportedState"
        },
        "desiredState": {
          "$ref": "#/$defs/ValveDesiredState"
        },
        "matches": {
          "type": "boolean",
          "description": "True if the reported state matches all desired changes. Note that if these are out of sync (matches = false) then you should wait until the physical valve has time to sync (matches = true) before modifying programs"
        }
      }
    },
    "WateringAction": {
      "type": "object",
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "durationSeconds": {
          "type": "integer",
          "format": "int64"
        },
        "reason": {
          "enum": [
            "QUICK_RUN",
            "BUTTON_PRESS",
            "PROGRAM"
          ],
          "type": "string",
          "format": "enum"
        },
        "programId": {
          "description": "Only present if the valve is open due to a program.",
          "type": "string"
        },
        "flowDetected": {
          "type": "boolean"
        }
      }
    }
  }
}