# airdress.switches.*

{/* Generated by scripts/generate-event-reference.mjs from https://schemas.airdress.co/operator/events/v1.json (operator v0.1.138).
    Do not edit by hand: run `pnpm generate:event-reference` and commit the result. */}

The events in the `airdress.switches` family. How to read a section, and what
each audience means, is on the [event reference](/events/) page.

## `airdress.switches.applied`

Owner info Functions

One switch changed value on a reload.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `feature` | string | yes |  |
| `from` | boolean | yes |  |
| `to` | boolean | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "One switch changed value on a reload.",
  "properties": {
    "feature": {
      "type": "string"
    },
    "from": {
      "type": "boolean"
    },
    "to": {
      "type": "boolean"
    }
  },
  "required": [
    "feature",
    "from",
    "to"
  ],
  "title": "SwitchApplied",
  "type": "object"
}
```

</details>

## `airdress.switches.rejected`

Owner warn Functions

The switches file could not be read or parsed; every switch keeps its value.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `reason` | string | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "The switches file could not be read or parsed; every switch keeps its value.",
  "properties": {
    "reason": {
      "type": "string"
    }
  },
  "required": [
    "reason"
  ],
  "title": "SwitchesRejected",
  "type": "object"
}
```

</details>

## `airdress.switches.reloaded`

Owner info Functions

The switches file was read and applied: the switches now in force, what they were before, and how many changed.

**Audience: owner.** About the airdress as a whole. Only the owner receives it: the owner's devices and the owner's subscriptions.

**Where it goes**

- **The operator's journal**, as one log line at this level, and **the event log**, where `airdress events tail` reads it.
- **Subscriptions** that name it, within its audience.
- **Functions bound to this operator's events** (`source: operator`).

**Versions**

- Version 1: first carried by operator v0.1.138.

**Data**

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `agent_bus` | boolean | yes |  |
| `agent_devices` | boolean | yes |  |
| `changed` | integer (uint) | yes |  |
| `mcp_local` | boolean | yes |  |
| `mcp_remote` | boolean | yes |  |
| `previous` | any | yes |  |
| `shells` | boolean | yes |  |

<details>
<summary>JSON Schema</summary>

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "The switches file was read and applied: the switches now in force, what they were before, and how many changed.",
  "properties": {
    "agent_bus": {
      "type": "boolean"
    },
    "agent_devices": {
      "type": "boolean"
    },
    "changed": {
      "format": "uint",
      "minimum": 0,
      "type": "integer"
    },
    "mcp_local": {
      "type": "boolean"
    },
    "mcp_remote": {
      "type": "boolean"
    },
    "previous": true,
    "shells": {
      "type": "boolean"
    }
  },
  "required": [
    "agent_bus",
    "agent_devices",
    "changed",
    "mcp_local",
    "mcp_remote",
    "previous",
    "shells"
  ],
  "title": "SwitchesReloaded",
  "type": "object"
}
```

</details>