{
  "schema": 1,
  "cases": [
    {
      "name": "fresh CO2",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 1234,
            "unit": "ppm",
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "name": "zero value",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 0,
            "unit": "ppm",
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "name": "overflow value",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 65536,
            "unit": "ppm",
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "name": "wrong units",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 1234,
            "unit": "mg/m³",
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "name": "string valid flag",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": "true",
            "value": 1234,
            "unit": "ppm",
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "name": "numeric valid flag",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": 1,
            "value": 1234,
            "unit": "ppm",
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "name": "expired sample",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 1234,
            "unit": "ppm",
            "age_ms": 20000
          }
        }
      },
      "valid": false
    },
    {
      "name": "negative age",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 1234,
            "unit": "ppm",
            "age_ms": -1
          }
        }
      },
      "valid": false
    },
    {
      "name": "wrapped age",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 1234,
            "unit": "ppm",
            "age_ms": 4294967296
          }
        }
      },
      "valid": false
    },
    {
      "name": "wrong schema",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 2,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 1234,
            "unit": "ppm",
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "name": "string schema",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": "1",
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 1234,
            "unit": "ppm",
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "name": "zero boot",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 0,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 1234,
            "unit": "ppm",
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "name": "sequence overflow",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 4294967296,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 1234,
            "unit": "ppm",
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "name": "uppercase ID",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456ABCDEF",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 1234,
            "unit": "ppm",
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "name": "embedded NUL ID",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef\u0000",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": true,
            "value": 1234,
            "unit": "ppm",
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "name": "explicit invalid sample",
      "schema": "sensor-co2-v1",
      "data": {
        "schema": 1,
        "device_id": "123456abcdef",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "co2": {
            "valid": false,
            "unit": "ppm",
            "age_ms": 20000
          }
        }
      },
      "valid": true
    },
    {
      "name": "external source",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "mqtt",
        "device_id": "123456abcdef",
        "double_click": "switch_display",
        "revision": 0
      },
      "valid": true
    },
    {
      "name": "local source",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "local",
        "device_id": "",
        "double_click": "none",
        "revision": 7
      },
      "valid": true
    },
    {
      "name": "source enum",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "wifi",
        "device_id": "123456abcdef",
        "double_click": "switch_display",
        "revision": 0
      },
      "valid": false
    },
    {
      "name": "upper ID",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "mqtt",
        "device_id": "123456ABCDEF",
        "double_click": "switch_display",
        "revision": 0
      },
      "valid": false
    },
    {
      "name": "NUL source",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "mqtt\u0000",
        "device_id": "123456abcdef",
        "double_click": "switch_display",
        "revision": 0
      },
      "valid": false
    },
    {
      "name": "NUL ID",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "mqtt",
        "device_id": "123456abcdef\u0000",
        "double_click": "switch_display",
        "revision": 0
      },
      "valid": false
    },
    {
      "name": "string revision",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "mqtt",
        "device_id": "123456abcdef",
        "double_click": "switch_display",
        "revision": "0"
      },
      "valid": false
    },
    {
      "name": "negative revision",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "mqtt",
        "device_id": "123456abcdef",
        "double_click": "switch_display",
        "revision": -1
      },
      "valid": false
    },
    {
      "name": "revision overflow",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "mqtt",
        "device_id": "123456abcdef",
        "double_click": "switch_display",
        "revision": 2147483648
      },
      "valid": false
    },
    {
      "name": "unknown action",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "mqtt",
        "device_id": "123456abcdef",
        "double_click": "toggle",
        "revision": 0
      },
      "valid": false
    },
    {
      "name": "unknown write field",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "mqtt",
        "device_id": "123456abcdef",
        "double_click": "switch_display",
        "revision": 0,
        "unknown": 1
      },
      "valid": false
    },
    {
      "name": "local with external ID",
      "schema": "m1-co2-source-set-v1",
      "data": {
        "source": "local",
        "device_id": "123456abcdef",
        "double_click": "switch_display",
        "revision": 0
      },
      "valid": false
    },
    {
      "name": "owner setup",
      "schema": "hub-setup-v1",
      "data": {
        "username": "local",
        "password": "local-password"
      },
      "valid": true
    },
    {
      "name": "short username",
      "schema": "hub-setup-v1",
      "data": {
        "username": "ab",
        "password": "local-password"
      },
      "valid": false
    },
    {
      "name": "nonlocal username",
      "schema": "hub-setup-v1",
      "data": {
        "username": "cloud@example.org",
        "password": "local-password"
      },
      "valid": false
    },
    {
      "name": "newline username",
      "schema": "hub-setup-v1",
      "data": {
        "username": "local\n",
        "password": "local-password"
      },
      "valid": false
    },
    {
      "name": "short password",
      "schema": "hub-setup-v1",
      "data": {
        "username": "local",
        "password": "1234567"
      },
      "valid": false
    },
    {
      "name": "NUL password",
      "schema": "hub-setup-v1",
      "data": {
        "username": "local",
        "password": "password\u0000"
      },
      "valid": false
    },
    {
      "name": "numeric password",
      "schema": "hub-setup-v1",
      "data": {
        "username": "local",
        "password": 12345678
      },
      "valid": false
    },
    {
      "name": "unknown setup field",
      "schema": "hub-setup-v1",
      "data": {
        "username": "local",
        "password": "local-password",
        "cloud_token": "token"
      },
      "valid": false
    },
    {
      "name": "explicit outbound route preserving password",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": true
    },
    {
      "name": "disabled empty bridge",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": false,
        "mappings": []
      },
      "valid": true
    },
    {
      "name": "numeric enabled",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": 1,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": false
    },
    {
      "name": "float port",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883.0,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": false
    },
    {
      "name": "port overflow",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 65536,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": false
    },
    {
      "name": "NUL upstream password",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream",
          "password": "a\u0000b"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": false
    },
    {
      "name": "wildcard route",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "home/+",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": false
    },
    {
      "name": "bidirectional route",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "both",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": false
    },
    {
      "name": "retained command route",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "device/command",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": false
    },
    {
      "name": "retained remote set route",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "device/set",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": false
    },
    {
      "name": "unknown route field",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false,
            "secret": true
          }
        ]
      },
      "valid": false
    },
    {
      "name": "route capacity",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          },
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          },
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          },
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          },
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          },
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          },
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          },
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          },
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": false
    },
    {
      "name": "unretained command route",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "device/command",
            "remote_topic": "home/remote",
            "retain": false,
            "allow_retained": false
          }
        ]
      },
      "valid": true
    },
    {
      "name": "registered TC1 channel",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "tc1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 5,
            "topic": "socket001"
          }
        ]
      },
      "valid": true
    },
    {
      "name": "preserve existing Bemfa key",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "tc1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 5,
            "topic": "socket001"
          }
        ]
      },
      "valid": true
    },
    {
      "name": "disabled empty Bemfa",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": false,
        "mappings": []
      },
      "valid": true
    },
    {
      "name": "short API key",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "short",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "tc1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 5,
            "topic": "socket001"
          }
        ]
      },
      "valid": false
    },
    {
      "name": "TC1 channel overflow",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "tc1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 6,
            "topic": "socket001"
          }
        ]
      },
      "valid": false
    },
    {
      "name": "boolean channel",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "tc1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": true,
            "topic": "socket001"
          }
        ]
      },
      "valid": false
    },
    {
      "name": "TC1 wrong suffix",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "tc1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 5,
            "topic": "socket002"
          }
        ]
      },
      "valid": false
    },
    {
      "name": "uppercase MAC",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456ABCDEF",
              "model": "tc1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 5,
            "topic": "socket001"
          }
        ]
      },
      "valid": false
    },
    {
      "name": "zero MAC",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "000000000000",
              "model": "tc1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 5,
            "topic": "socket001"
          }
        ]
      },
      "valid": false
    },
    {
      "name": "sensor Bemfa mapping",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "m1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 5,
            "topic": "socket001"
          }
        ]
      },
      "valid": false
    },
    {
      "name": "newline device owner",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "tc1",
              "version": "v2",
              "status": "active",
              "username": "local\n"
            },
            "channel": 5,
            "topic": "socket001"
          }
        ]
      },
      "valid": false
    },
    {
      "name": "enabled no mappings",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": []
      },
      "valid": false
    },
    {
      "name": "unknown Bemfa field",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "tc1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 5,
            "topic": "socket001"
          }
        ],
        "unknown": true
      },
      "valid": false
    },
    {
      "name": "A1 fan mapping",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "a1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 0,
            "topic": "fan003"
          }
        ]
      },
      "valid": true
    },
    {
      "name": "A1 fan light suffix mismatch",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "a1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 0,
            "topic": "fan002"
          }
        ]
      },
      "valid": false
    },
    {
      "name": "A1 light mapping",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "a1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 1,
            "topic": "light002"
          }
        ]
      },
      "valid": true
    },
    {
      "name": "A1 channel overflow",
      "schema": "hub-bemfa-set-v1",
      "data": {
        "enabled": true,
        "api_key": "0123456789abcdef",
        "mappings": [
          {
            "device": {
              "mac": "123456abcdef",
              "model": "a1",
              "version": "v2",
              "status": "active",
              "username": "local"
            },
            "channel": 2,
            "topic": "light002"
          }
        ]
      },
      "valid": false
    },
    {
      "name": "enable HAP",
      "schema": "hub-homekit-set-v1",
      "data": {
        "enabled": true
      },
      "valid": true
    },
    {
      "name": "disable HAP",
      "schema": "hub-homekit-set-v1",
      "data": {
        "enabled": false
      },
      "valid": true
    },
    {
      "name": "missing HAP enabled",
      "schema": "hub-homekit-set-v1",
      "data": {},
      "valid": false
    },
    {
      "name": "numeric HAP enabled",
      "schema": "hub-homekit-set-v1",
      "data": {
        "enabled": 1
      },
      "valid": false
    },
    {
      "name": "client supplied pairing code",
      "schema": "hub-homekit-set-v1",
      "data": {
        "enabled": true,
        "setup_code": "123-45-678"
      },
      "valid": false
    },
    {
      "name": "Matter is not HAP configuration",
      "schema": "hub-homekit-set-v1",
      "data": {
        "enabled": true,
        "protocol": "matter"
      },
      "valid": false
    },
    {
      "name": "explicit pairing erase",
      "schema": "hub-homekit-reset-v1",
      "data": {
        "confirm": true
      },
      "valid": true
    },
    {
      "name": "missing erase confirmation",
      "schema": "hub-homekit-reset-v1",
      "data": {},
      "valid": false
    },
    {
      "name": "refused erase",
      "schema": "hub-homekit-reset-v1",
      "data": {
        "confirm": false
      },
      "valid": false
    },
    {
      "name": "numeric erase confirmation",
      "schema": "hub-homekit-reset-v1",
      "data": {
        "confirm": 1
      },
      "valid": false
    },
    {
      "name": "unknown erase option",
      "schema": "hub-homekit-reset-v1",
      "data": {
        "confirm": true,
        "factory": true
      },
      "valid": false
    },
    {
      "name": "healthy unpaired HAP",
      "schema": "hub-homekit-state-v1",
      "data": {
        "enabled": true,
        "protocol": "hap",
        "ready": true,
        "code": "ok",
        "paired": false,
        "devices": 2,
        "port": 51826,
        "setup_code": "321-45-678",
        "setup_uri": "X-HM://001234567ABCD"
      },
      "valid": true
    },
    {
      "name": "paired HAP hides credentials",
      "schema": "hub-homekit-state-v1",
      "data": {
        "enabled": true,
        "protocol": "hap",
        "ready": true,
        "code": "ok",
        "paired": true,
        "devices": 2,
        "port": 51826
      },
      "valid": true
    },
    {
      "name": "failed storage HAP",
      "schema": "hub-homekit-state-v1",
      "data": {
        "enabled": true,
        "protocol": "hap",
        "ready": false,
        "code": "storage_error",
        "paired": false,
        "devices": 2,
        "port": 51826
      },
      "valid": true
    },
    {
      "name": "paired credentials leak",
      "schema": "hub-homekit-state-v1",
      "data": {
        "enabled": true,
        "protocol": "hap",
        "ready": true,
        "code": "ok",
        "paired": true,
        "devices": 2,
        "port": 51826,
        "setup_code": "321-45-678",
        "setup_uri": "X-HM://001234567ABCD"
      },
      "valid": false
    },
    {
      "name": "unready credentials leak",
      "schema": "hub-homekit-state-v1",
      "data": {
        "enabled": true,
        "protocol": "hap",
        "ready": false,
        "code": "ok",
        "paired": false,
        "devices": 2,
        "port": 51826,
        "setup_code": "321-45-678",
        "setup_uri": "X-HM://001234567ABCD"
      },
      "valid": false
    },
    {
      "name": "disabled credentials leak",
      "schema": "hub-homekit-state-v1",
      "data": {
        "enabled": false,
        "protocol": "hap",
        "ready": true,
        "code": "ok",
        "paired": false,
        "devices": 2,
        "port": 51826,
        "setup_code": "321-45-678",
        "setup_uri": "X-HM://001234567ABCD"
      },
      "valid": false
    },
    {
      "name": "wrong home protocol",
      "schema": "hub-homekit-state-v1",
      "data": {
        "enabled": true,
        "protocol": "matter",
        "ready": true,
        "code": "ok",
        "paired": false,
        "devices": 2,
        "port": 51826,
        "setup_code": "321-45-678",
        "setup_uri": "X-HM://001234567ABCD"
      },
      "valid": false
    },
    {
      "name": "HAP roster overflow",
      "schema": "hub-homekit-state-v1",
      "data": {
        "enabled": true,
        "protocol": "hap",
        "ready": true,
        "code": "ok",
        "paired": false,
        "devices": 13,
        "port": 51826,
        "setup_code": "321-45-678",
        "setup_uri": "X-HM://001234567ABCD"
      },
      "valid": false
    },
    {
      "name": "float HAP port",
      "schema": "hub-homekit-state-v1",
      "data": {
        "enabled": true,
        "protocol": "hap",
        "ready": true,
        "code": "ok",
        "paired": false,
        "devices": 2,
        "port": 51826.0,
        "setup_code": "321-45-678",
        "setup_uri": "X-HM://001234567ABCD"
      },
      "valid": false
    },
    {
      "name": "default OFF sensor reminder",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75,
        "red": 150,
        "revision": 0,
        "buzzer_enabled": false
      },
      "valid": true
    },
    {
      "name": "omitted switch preserves legacy caller",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75,
        "red": 150,
        "revision": 0
      },
      "valid": true
    },
    {
      "name": "maximum raw thresholds",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "hcho",
        "yellow": 65535,
        "red": 65535,
        "revision": 2147483647,
        "buzzer_enabled": true
      },
      "valid": true
    },
    {
      "name": "unsupported reminder sensor",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "co2",
        "yellow": 75,
        "red": 150,
        "revision": 0,
        "buzzer_enabled": false
      },
      "valid": false
    },
    {
      "name": "negative threshold",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": -1,
        "red": 150,
        "revision": 0,
        "buzzer_enabled": false
      },
      "valid": false
    },
    {
      "name": "zero red threshold",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75,
        "red": 0,
        "revision": 0,
        "buzzer_enabled": false
      },
      "valid": false
    },
    {
      "name": "threshold overflow",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75,
        "red": 65536,
        "revision": 0,
        "buzzer_enabled": false
      },
      "valid": false
    },
    {
      "name": "float threshold",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75.0,
        "red": 150,
        "revision": 0,
        "buzzer_enabled": false
      },
      "valid": false
    },
    {
      "name": "boolean revision",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75,
        "red": 150,
        "revision": true,
        "buzzer_enabled": false
      },
      "valid": false
    },
    {
      "name": "revision overflow",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75,
        "red": 150,
        "revision": 2147483648,
        "buzzer_enabled": false
      },
      "valid": false
    },
    {
      "name": "numeric buzzer switch",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75,
        "red": 150,
        "revision": 0,
        "buzzer_enabled": 0
      },
      "valid": false
    },
    {
      "name": "string buzzer switch",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75,
        "red": 150,
        "revision": 0,
        "buzzer_enabled": "false"
      },
      "valid": false
    },
    {
      "name": "null buzzer switch",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75,
        "red": 150,
        "revision": 0,
        "buzzer_enabled": null
      },
      "valid": false
    },
    {
      "name": "unknown alarm write field",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75,
        "red": 150,
        "revision": 0,
        "buzzer_enabled": false,
        "unknown": false
      },
      "valid": false
    },
    {
      "name": "missing alarm revision",
      "schema": "m1-alarm-set-v1",
      "data": {
        "sensor": "pm25",
        "yellow": 75,
        "red": 150,
        "buzzer_enabled": false
      },
      "valid": false
    },
    {
      "name": "legacy MCU desired OFF actual unknown",
      "schema": "m1-alarm-state-v1",
      "data": {
        "revision": 1,
        "hcho_configured": false,
        "pm25_configured": true,
        "hcho_yellow": 0,
        "hcho_red": 0,
        "pm25_yellow": 75,
        "pm25_red": 150,
        "hcho_buzzer_enabled": false,
        "pm25_buzzer_enabled": false,
        "buzzer_supported": false,
        "mcu_alarm_schema": 0,
        "buzzer_confirmed": false,
        "buzzer_confirmation": "requires_mcu_upgrade",
        "mcu_hcho_buzzer_enabled": null,
        "mcu_pm25_buzzer_enabled": null,
        "mcu_buzzer_mask": null,
        "sensor_alarm_active": null,
        "uart_sent": true,
        "unit": "main_controller_raw_u16",
        "confirmation": "uart_send_only"
      },
      "valid": true
    },
    {
      "name": "new MCU pending independent read",
      "schema": "m1-alarm-state-v1",
      "data": {
        "revision": 1,
        "hcho_configured": false,
        "pm25_configured": true,
        "hcho_yellow": 0,
        "hcho_red": 0,
        "pm25_yellow": 75,
        "pm25_red": 150,
        "hcho_buzzer_enabled": false,
        "pm25_buzzer_enabled": false,
        "buzzer_supported": true,
        "mcu_alarm_schema": 1,
        "buzzer_confirmed": false,
        "buzzer_confirmation": "pending_mcu_readback",
        "mcu_hcho_buzzer_enabled": null,
        "mcu_pm25_buzzer_enabled": null,
        "mcu_buzzer_mask": null,
        "sensor_alarm_active": null,
        "uart_sent": true,
        "unit": "main_controller_raw_u16",
        "confirmation": "uart_send_only"
      },
      "valid": true
    },
    {
      "name": "fresh independently confirmed OFF",
      "schema": "m1-alarm-state-v1",
      "data": {
        "revision": 1,
        "hcho_configured": false,
        "pm25_configured": true,
        "hcho_yellow": 0,
        "hcho_red": 0,
        "pm25_yellow": 75,
        "pm25_red": 150,
        "hcho_buzzer_enabled": false,
        "pm25_buzzer_enabled": false,
        "buzzer_supported": true,
        "mcu_alarm_schema": 1,
        "buzzer_confirmed": true,
        "buzzer_confirmation": "mcu_readback",
        "mcu_hcho_buzzer_enabled": false,
        "mcu_pm25_buzzer_enabled": false,
        "mcu_buzzer_mask": 0,
        "sensor_alarm_active": false,
        "uart_sent": true,
        "unit": "main_controller_raw_u16",
        "confirmation": "uart_send_only"
      },
      "valid": true
    },
    {
      "name": "forward response field allowed",
      "schema": "m1-alarm-state-v1",
      "data": {
        "revision": 1,
        "hcho_configured": false,
        "pm25_configured": true,
        "hcho_yellow": 0,
        "hcho_red": 0,
        "pm25_yellow": 75,
        "pm25_red": 150,
        "hcho_buzzer_enabled": false,
        "pm25_buzzer_enabled": false,
        "buzzer_supported": true,
        "mcu_alarm_schema": 1,
        "buzzer_confirmed": true,
        "buzzer_confirmation": "mcu_readback",
        "mcu_hcho_buzzer_enabled": false,
        "mcu_pm25_buzzer_enabled": false,
        "mcu_buzzer_mask": 0,
        "sensor_alarm_active": false,
        "uart_sent": true,
        "unit": "main_controller_raw_u16",
        "confirmation": "uart_send_only",
        "future_diagnostic": "value"
      },
      "valid": true
    },
    {
      "name": "legacy cannot claim confirmation",
      "schema": "m1-alarm-state-v1",
      "data": {
        "revision": 1,
        "hcho_configured": false,
        "pm25_configured": true,
        "hcho_yellow": 0,
        "hcho_red": 0,
        "pm25_yellow": 75,
        "pm25_red": 150,
        "hcho_buzzer_enabled": false,
        "pm25_buzzer_enabled": false,
        "buzzer_supported": false,
        "mcu_alarm_schema": 0,
        "buzzer_confirmed": true,
        "buzzer_confirmation": "requires_mcu_upgrade",
        "mcu_hcho_buzzer_enabled": null,
        "mcu_pm25_buzzer_enabled": null,
        "mcu_buzzer_mask": null,
        "sensor_alarm_active": null,
        "uart_sent": true,
        "unit": "main_controller_raw_u16",
        "confirmation": "uart_send_only"
      },
      "valid": false
    },
    {
      "name": "unknown actual fields must remain null together",
      "schema": "m1-alarm-state-v1",
      "data": {
        "revision": 1,
        "hcho_configured": false,
        "pm25_configured": true,
        "hcho_yellow": 0,
        "hcho_red": 0,
        "pm25_yellow": 75,
        "pm25_red": 150,
        "hcho_buzzer_enabled": false,
        "pm25_buzzer_enabled": false,
        "buzzer_supported": false,
        "mcu_alarm_schema": 0,
        "buzzer_confirmed": false,
        "buzzer_confirmation": "requires_mcu_upgrade",
        "mcu_hcho_buzzer_enabled": null,
        "mcu_pm25_buzzer_enabled": null,
        "mcu_buzzer_mask": 0,
        "sensor_alarm_active": null,
        "uart_sent": true,
        "unit": "main_controller_raw_u16",
        "confirmation": "uart_send_only"
      },
      "valid": false
    },
    {
      "name": "pending cannot claim readback",
      "schema": "m1-alarm-state-v1",
      "data": {
        "revision": 1,
        "hcho_configured": false,
        "pm25_configured": true,
        "hcho_yellow": 0,
        "hcho_red": 0,
        "pm25_yellow": 75,
        "pm25_red": 150,
        "hcho_buzzer_enabled": false,
        "pm25_buzzer_enabled": false,
        "buzzer_supported": true,
        "mcu_alarm_schema": 1,
        "buzzer_confirmed": false,
        "buzzer_confirmation": "mcu_readback",
        "mcu_hcho_buzzer_enabled": null,
        "mcu_pm25_buzzer_enabled": null,
        "mcu_buzzer_mask": null,
        "sensor_alarm_active": null,
        "uart_sent": true,
        "unit": "main_controller_raw_u16",
        "confirmation": "uart_send_only"
      },
      "valid": false
    },
    {
      "name": "actual mask overflow",
      "schema": "m1-alarm-state-v1",
      "data": {
        "revision": 1,
        "hcho_configured": false,
        "pm25_configured": true,
        "hcho_yellow": 0,
        "hcho_red": 0,
        "pm25_yellow": 75,
        "pm25_red": 150,
        "hcho_buzzer_enabled": false,
        "pm25_buzzer_enabled": false,
        "buzzer_supported": true,
        "mcu_alarm_schema": 1,
        "buzzer_confirmed": true,
        "buzzer_confirmation": "mcu_readback",
        "mcu_hcho_buzzer_enabled": false,
        "mcu_pm25_buzzer_enabled": false,
        "mcu_buzzer_mask": 8,
        "sensor_alarm_active": false,
        "uart_sent": true,
        "unit": "main_controller_raw_u16",
        "confirmation": "uart_send_only"
      },
      "valid": false
    },
    {
      "name": "numeric actual alarm flag",
      "schema": "m1-alarm-state-v1",
      "data": {
        "revision": 1,
        "hcho_configured": false,
        "pm25_configured": true,
        "hcho_yellow": 0,
        "hcho_red": 0,
        "pm25_yellow": 75,
        "pm25_red": 150,
        "hcho_buzzer_enabled": false,
        "pm25_buzzer_enabled": false,
        "buzzer_supported": true,
        "mcu_alarm_schema": 1,
        "buzzer_confirmed": true,
        "buzzer_confirmation": "mcu_readback",
        "mcu_hcho_buzzer_enabled": false,
        "mcu_pm25_buzzer_enabled": false,
        "mcu_buzzer_mask": 0,
        "sensor_alarm_active": 1,
        "uart_sent": true,
        "unit": "main_controller_raw_u16",
        "confirmation": "uart_send_only"
      },
      "valid": false
    },
    {
      "name": "confirmed cannot have unknown actual",
      "schema": "m1-alarm-state-v1",
      "data": {
        "revision": 1,
        "hcho_configured": false,
        "pm25_configured": true,
        "hcho_yellow": 0,
        "hcho_red": 0,
        "pm25_yellow": 75,
        "pm25_red": 150,
        "hcho_buzzer_enabled": false,
        "pm25_buzzer_enabled": false,
        "buzzer_supported": true,
        "mcu_alarm_schema": 1,
        "buzzer_confirmed": true,
        "buzzer_confirmation": "mcu_readback",
        "mcu_hcho_buzzer_enabled": false,
        "mcu_pm25_buzzer_enabled": null,
        "mcu_buzzer_mask": 0,
        "sensor_alarm_active": false,
        "uart_sent": true,
        "unit": "main_controller_raw_u16",
        "confirmation": "uart_send_only"
      },
      "valid": false
    },
    {
      "name": "threshold confirmation stays send only",
      "schema": "m1-alarm-state-v1",
      "data": {
        "revision": 1,
        "hcho_configured": false,
        "pm25_configured": true,
        "hcho_yellow": 0,
        "hcho_red": 0,
        "pm25_yellow": 75,
        "pm25_red": 150,
        "hcho_buzzer_enabled": false,
        "pm25_buzzer_enabled": false,
        "buzzer_supported": true,
        "mcu_alarm_schema": 1,
        "buzzer_confirmed": true,
        "buzzer_confirmation": "mcu_readback",
        "mcu_hcho_buzzer_enabled": false,
        "mcu_pm25_buzzer_enabled": false,
        "mcu_buzzer_mask": 0,
        "sensor_alarm_active": false,
        "uart_sent": true,
        "unit": "main_controller_raw_u16",
        "confirmation": "mcu_readback"
      },
      "valid": false
    },
    {
      "name": "512-byte ASCII local_topic",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": true
    },
    {
      "name": "513-byte ASCII local_topic",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "remote_topic": "home/remote",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": false
    },
    {
      "name": "512-byte ASCII remote_topic",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": true
    },
    {
      "name": "513-byte ASCII remote_topic",
      "schema": "hub-bridge-set-v1",
      "data": {
        "enabled": true,
        "mqtt": {
          "host": "broker.lan",
          "port": 1883,
          "user": "upstream"
        },
        "mappings": [
          {
            "direction": "out",
            "local_topic": "home/local",
            "remote_topic": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "retain": true,
            "allow_retained": false
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "default independent lanes",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "TC1 power and independent API reading",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "local metric temperature",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "local",
            "device_id": "",
            "metric": "temperature",
            "unit": "°C",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "local metric humidity",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "local",
            "device_id": "",
            "metric": "humidity",
            "unit": "%",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "local metric pm25",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "local",
            "device_id": "",
            "metric": "pm25",
            "unit": "µg/m³",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "local metric formaldehyde",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "local",
            "device_id": "",
            "metric": "formaldehyde",
            "unit": "mg/m³",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "local metric co2",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "local",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "local metric pressure",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "local",
            "device_id": "",
            "metric": "pressure",
            "unit": "Pa",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt metric temperature",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "temperature",
            "unit": "°C",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt metric humidity",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "humidity",
            "unit": "%",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt metric pm25",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "pm25",
            "unit": "µg/m³",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt metric formaldehyde",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "formaldehyde",
            "unit": "mg/m³",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt metric co2",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt metric pressure",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "pressure",
            "unit": "Pa",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt metric power",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt metric energy",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "energy",
            "unit": "kWh",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt metric tvoc",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "tvoc",
            "unit": "ppb",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt metric pm10",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "pm10",
            "unit": "µg/m³",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api metric temperature",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "temperature",
            "unit": "°C",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api metric humidity",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "humidity",
            "unit": "%",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api metric pm25",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "pm25",
            "unit": "µg/m³",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api metric formaldehyde",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "formaldehyde",
            "unit": "mg/m³",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api metric co2",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api metric pressure",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "pressure",
            "unit": "Pa",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api metric power",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "power",
            "unit": "W",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api metric energy",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "energy",
            "unit": "kWh",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api metric tvoc",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "tvoc",
            "unit": "ppb",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api metric pm10",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "pm10",
            "unit": "µg/m³",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "duplicate slot",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "missing lane",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "third lane",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          },
          {
            "slot": 0,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "unknown field",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {}
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "fractional revision",
      "data": {
        "revision": 1.0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "boolean revision",
      "data": {
        "revision": true,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "legacy source name",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "co2",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt uppercase ID",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "ABCDEF001122",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "power wrong unit",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "mg/m³",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "local power unsupported",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "local",
            "device_id": "",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "zero configured TTL",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 0,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "TTL 61",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 61,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "scale 10",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 10,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "decimal 3",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 3,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "decimal float",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 1.0,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "equal thresholds",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 100
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "reversed thresholds",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 200,
              "high": 100
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "unsupported color",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "blue"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "custom unlisted unit",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "rpm",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "custom embedded NUL unit",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%\u0000",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "none nonempty metric",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "humidity",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api device ID nonempty",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "001122334455",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-data-set-v2",
      "name": "leased API value",
      "data": {
        "revision": 1,
        "slot": 1,
        "value": 45.6,
        "unit": "%",
        "ttl_seconds": 10,
        "color": "yellow"
      },
      "valid": true
    },
    {
      "schema": "m1-display-data-set-v2",
      "name": "clear API lane without fake zero",
      "data": {
        "revision": 1,
        "slot": 1,
        "ttl_seconds": 0
      },
      "valid": true
    },
    {
      "schema": "m1-display-data-set-v2",
      "name": "zero TTL with value",
      "data": {
        "revision": 1,
        "slot": 1,
        "value": 45.6,
        "unit": "%",
        "ttl_seconds": 0,
        "color": "yellow"
      },
      "valid": false
    },
    {
      "schema": "m1-display-data-set-v2",
      "name": "TTL overflow",
      "data": {
        "revision": 1,
        "slot": 1,
        "value": 45.6,
        "unit": "%",
        "ttl_seconds": 61,
        "color": "yellow"
      },
      "valid": false
    },
    {
      "schema": "m1-display-data-set-v2",
      "name": "slot overflow",
      "data": {
        "revision": 1,
        "slot": 2,
        "value": 45.6,
        "unit": "%",
        "ttl_seconds": 10,
        "color": "yellow"
      },
      "valid": false
    },
    {
      "schema": "m1-display-data-set-v2",
      "name": "negative number",
      "data": {
        "revision": 1,
        "slot": 1,
        "value": -1,
        "unit": "%",
        "ttl_seconds": 10,
        "color": "yellow"
      },
      "valid": false
    },
    {
      "schema": "m1-display-data-set-v2",
      "name": "numeric string",
      "data": {
        "revision": 1,
        "slot": 1,
        "value": "45.6",
        "unit": "%",
        "ttl_seconds": 10,
        "color": "yellow"
      },
      "valid": false
    },
    {
      "schema": "m1-display-data-set-v2",
      "name": "bad unit",
      "data": {
        "revision": 1,
        "slot": 1,
        "value": 45.6,
        "unit": "watts",
        "ttl_seconds": 10,
        "color": "yellow"
      },
      "valid": false
    },
    {
      "schema": "m1-display-data-set-v2",
      "name": "fractional revision",
      "data": {
        "revision": 1.0,
        "slot": 1,
        "value": 45.6,
        "unit": "%",
        "ttl_seconds": 10,
        "color": "yellow"
      },
      "valid": false
    },
    {
      "schema": "m1-display-data-set-v2",
      "name": "arbitrary extra field",
      "data": {
        "revision": 1,
        "slot": 1,
        "value": 45.6,
        "unit": "%",
        "ttl_seconds": 10,
        "color": "yellow",
        "source": "mqtt"
      },
      "valid": false
    },
    {
      "schema": "m1-display-data-set-v2",
      "name": "boolean value",
      "data": {
        "revision": 1,
        "slot": 1,
        "value": true,
        "unit": "%",
        "ttl_seconds": 10,
        "color": "yellow"
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "desired with pending runtime",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": false
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": false
            }
          ]
        }
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "MCU readback without optical assertion",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": true,
          "confirmation": "mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            }
          ]
        }
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "old MCU preserves desired",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": false,
          "confirmed": false,
          "confirmation": "requires_mcu_upgrade",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": false
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": false
            }
          ]
        }
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "unsupported MCU cannot be confirmed",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": false,
          "confirmed": true,
          "confirmation": "requires_mcu_upgrade",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": false
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "TC1 fresh physical power",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "W",
            "valid": true,
            "age_ms": 250
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "TC1 stale measurement is null",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": null,
            "unit": "W",
            "valid": false,
            "age_ms": 25000
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "typed temperature",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "temperature": {
            "value": 1,
            "unit": "°C",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "typed humidity",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "humidity": {
            "value": 1,
            "unit": "%",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "typed pm25",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "pm25": {
            "value": 1,
            "unit": "µg/m³",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "typed formaldehyde",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "formaldehyde": {
            "value": 1,
            "unit": "mg/m³",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "typed co2",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "co2": {
            "value": 1,
            "unit": "ppm",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "typed pressure",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "pressure": {
            "value": 1,
            "unit": "Pa",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "typed power",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 1,
            "unit": "W",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "typed energy",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "energy": {
            "value": 1,
            "unit": "kWh",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "typed tvoc",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "tvoc": {
            "value": 1,
            "unit": "ppb",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "typed pm10",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "pm10": {
            "value": 1,
            "unit": "µg/m³",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "wrong W unit",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "kW",
            "valid": true,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "valid stale power",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "W",
            "valid": true,
            "age_ms": 20000
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "negative power",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": -1,
            "unit": "W",
            "valid": true,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "invalid fake zero",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 0,
            "unit": "W",
            "valid": false,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "number valid flag",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "W",
            "valid": 1,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "null valid value",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": null,
            "unit": "W",
            "valid": true,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "zero sequence",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 0,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "W",
            "valid": true,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "negative boot",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": -1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "W",
            "valid": true,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "floating sequence",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 2.0,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "W",
            "valid": true,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "wrong device_id field",
      "data": {
        "schema": 1,
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "W",
            "valid": true,
            "age_ms": 250
          }
        },
        "id": "001122334455"
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "empty sensors",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {}
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "unknown only sensor",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "whatever": {}
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "mqtt A1 main fan output percent",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "fan_speed_percent",
            "unit": "%",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "api A1 main fan output percent",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "fan_speed_percent",
            "unit": "%",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "local A1 main fan output percent",
      "data": {
        "revision": 0,
        "selected_source": "original",
        "double_click": "none",
        "lanes": [
          {
            "slot": 0,
            "source": "local",
            "device_id": "",
            "metric": "fan_speed_percent",
            "unit": "%",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          },
          {
            "slot": 1,
            "source": "none",
            "device_id": "",
            "metric": "custom",
            "unit": "",
            "decimals": 0,
            "scale": 1,
            "ttl_seconds": 20,
            "color": {
              "mode": "fixed",
              "value": "off"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "A1 effective main fan percent",
      "data": {
        "schema": 1,
        "device_id": "aabbccddeeff",
        "model": "a1",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "fan_speed_percent": {
            "value": 60,
            "unit": "%",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "A1 fan percent 0",
      "data": {
        "schema": 1,
        "device_id": "aabbccddeeff",
        "model": "a1",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "fan_speed_percent": {
            "value": 0,
            "unit": "%",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "A1 fan percent 100",
      "data": {
        "schema": 1,
        "device_id": "aabbccddeeff",
        "model": "a1",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "fan_speed_percent": {
            "value": 100,
            "unit": "%",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": true
    },
    {
      "schema": "sensor-values-v1",
      "name": "A1 fan percent 100.01",
      "data": {
        "schema": 1,
        "device_id": "aabbccddeeff",
        "model": "a1",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "fan_speed_percent": {
            "value": 100.01,
            "unit": "%",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "A1 fan percent -1",
      "data": {
        "schema": 1,
        "device_id": "aabbccddeeff",
        "model": "a1",
        "boot": 123,
        "sequence": 1,
        "sensors": {
          "fan_speed_percent": {
            "value": -1,
            "unit": "%",
            "valid": true,
            "age_ms": 0
          }
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-set-v2",
      "name": "exact ID rejects trailing newline",
      "data": {
        "revision": 0,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455\n",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ]
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "exact ID rejects trailing newline",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455\n",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": false
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "exact ID rejects trailing newline",
      "data": {
        "schema": 1,
        "device_id": "001122334455\n",
        "model": "tc1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "W",
            "valid": true,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "unknown producer model",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "unknown",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "W",
            "valid": true,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "A1 cannot publish power",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "a1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "W",
            "valid": true,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "sensor-values-v1",
      "name": "M1 cannot publish power",
      "data": {
        "schema": 1,
        "device_id": "001122334455",
        "model": "m1",
        "boot": 1,
        "sequence": 2,
        "sensors": {
          "power": {
            "value": 1234.5,
            "unit": "W",
            "valid": true,
            "age_ms": 250
          }
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "real production C dual GET readback",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": true,
          "confirmation": "mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": 1234,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 19,
              "effective": true,
              "reason": "ok",
              "number": 123,
              "format": 1,
              "color": "yellow",
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": true,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": true
            }
          ]
        }
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "global confirmation requires both lane readbacks",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": true,
          "confirmation": "mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "global confirmation cannot use legacy profile",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "legacy",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": true,
          "confirmation": "mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "readback label requires global confirmation",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "pending label cannot claim global confirmation",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": true,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "supported MCU cannot report upgrade required",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "requires_mcu_upgrade",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "dual global confirmation is conjunction of lane readbacks",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "legacy cached lane readbacks do not confirm dual profile",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "mqtt",
            "device_id": "001122334455",
            "metric": "power",
            "unit": "W",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 15,
            "color": {
              "mode": "thresholds",
              "low": 100,
              "high": 1000
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "%",
            "decimals": 1,
            "scale": 1,
            "ttl_seconds": 10,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "legacy",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": null,
              "unit": "W",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": false,
              "value": null,
              "unit": "%",
              "age_ms": null,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "missing",
              "number": null,
              "format": null,
              "color": null,
              "confirmed": true
            }
          ]
        }
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "valid lane requires physical value",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": null,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 19,
              "effective": true,
              "reason": "ok",
              "number": 123,
              "format": 1,
              "color": "yellow",
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": false,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "valid lane requires encoded format",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": 1234,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 19,
              "effective": true,
              "reason": "ok",
              "number": 123,
              "format": null,
              "color": "yellow",
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": false,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "valid lane requires encoded number",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": 1234,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 19,
              "effective": true,
              "reason": "ok",
              "number": null,
              "format": 1,
              "color": "yellow",
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": false,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "valid lane requires color",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": 1234,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 19,
              "effective": true,
              "reason": "ok",
              "number": 123,
              "format": 1,
              "color": null,
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": false,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "valid lane requires known age",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": 1234,
              "unit": "ppm",
              "age_ms": null,
              "remaining_ttl_seconds": 19,
              "effective": true,
              "reason": "ok",
              "number": 123,
              "format": 1,
              "color": "yellow",
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": false,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "valid lane requires positive remaining lease",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": 1234,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 0,
              "effective": true,
              "reason": "ok",
              "number": 123,
              "format": 1,
              "color": "yellow",
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": false,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "valid lane cannot report stale reason",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": 1234,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 19,
              "effective": true,
              "reason": "stale",
              "number": 123,
              "format": 1,
              "color": "yellow",
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": false,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "effective lane requires its own readback",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": 1234,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 19,
              "effective": true,
              "reason": "ok",
              "number": 123,
              "format": 1,
              "color": "yellow",
              "confirmed": false
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": false,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "invalid lane cannot retain visible value",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": false,
              "value": 1234,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 0,
              "effective": false,
              "reason": "stale",
              "number": 123,
              "format": 1,
              "color": "yellow",
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": false,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": false
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "valid values await MCU readback",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": false,
          "confirmation": "pending_mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": 1234,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 19,
              "effective": false,
              "reason": "ok",
              "number": 123,
              "format": 1,
              "color": "yellow",
              "confirmed": false
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": false,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": false
            }
          ]
        }
      },
      "valid": true
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "runtime format is a strict integer token",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": true,
          "confirmed": true,
          "confirmation": "mcu_readback",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": 1234,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 19,
              "effective": true,
              "reason": "ok",
              "number": 123,
              "format": 1.0,
              "color": "yellow",
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": true,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": true
            }
          ]
        }
      },
      "valid": false
    },
    {
      "schema": "m1-display-source-state-v2",
      "name": "unsupported MCU cannot show an effective lane",
      "data": {
        "revision": 1,
        "selected_source": "user",
        "double_click": "switch_display",
        "lanes": [
          {
            "slot": 0,
            "source": "api",
            "device_id": "",
            "metric": "co2",
            "unit": "ppm",
            "decimals": 2,
            "scale": 1000,
            "ttl_seconds": 20,
            "color": {
              "mode": "thresholds",
              "low": 1000,
              "high": 1500
            }
          },
          {
            "slot": 1,
            "source": "api",
            "device_id": "",
            "metric": "custom",
            "unit": "W",
            "decimals": 1,
            "scale": 1000,
            "ttl_seconds": 4,
            "color": {
              "mode": "fixed",
              "value": "green"
            }
          }
        ],
        "runtime": {
          "profile": "dual",
          "selected_source": "user",
          "mcu_supported": false,
          "confirmed": false,
          "confirmation": "requires_mcu_upgrade",
          "lanes": [
            {
              "slot": 0,
              "valid": true,
              "value": 1234,
              "unit": "ppm",
              "age_ms": 1250,
              "remaining_ttl_seconds": 19,
              "effective": true,
              "reason": "ok",
              "number": 123,
              "format": 1,
              "color": "yellow",
              "confirmed": true
            },
            {
              "slot": 1,
              "valid": true,
              "value": 1200,
              "unit": "W",
              "age_ms": 1250,
              "remaining_ttl_seconds": 3,
              "effective": true,
              "reason": "ok",
              "number": 12,
              "format": 2,
              "color": "green",
              "confirmed": true
            }
          ]
        }
      },
      "valid": false
    }
  ]
}
