Fix invalid JSONs (#37171)

Validated & fixes all invalid JSON code blocks
This commit is contained in:
Xitee 2025-01-28 19:43:09 +01:00 committed by GitHub
parent 052c0ef649
commit 4979864292
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -360,12 +360,12 @@ The component specific options are placed as mappings under the `components` key
"mdl": "xya", "mdl": "xya",
"sw": "1.0", "sw": "1.0",
"sn": "ea334450945afc", "sn": "ea334450945afc",
"hw": "1.0rev2", "hw": "1.0rev2"
}, },
"o": { "o": {
"name":"bla2mqtt", "name":"bla2mqtt",
"sw": "2.1", "sw": "2.1",
"url": "https://bla2mqtt.example.com/support", "url": "https://bla2mqtt.example.com/support"
}, },
"cmps": { "cmps": {
"some_unique_component_id1": { "some_unique_component_id1": {
@ -373,18 +373,18 @@ The component specific options are placed as mappings under the `components` key
"device_class":"temperature", "device_class":"temperature",
"unit_of_measurement":"°C", "unit_of_measurement":"°C",
"value_template":"{% raw %}{{ value_json.temperature}}{% endraw %}", "value_template":"{% raw %}{{ value_json.temperature}}{% endraw %}",
"unique_id":"temp01ae_t", "unique_id":"temp01ae_t"
}, },
"some_unique_id2": { "some_unique_id2": {
"p": "sensor", "p": "sensor",
"device_class":"humidity", "device_class":"humidity",
"unit_of_measurement":"%", "unit_of_measurement":"%",
"value_template":"{% raw %}{{ value_json.humidity}}{% endraw %}", "value_template":"{% raw %}{{ value_json.humidity}}{% endraw %}",
"unique_id":"temp01ae_h", "unique_id":"temp01ae_h"
} }
}, },
"state_topic":"sensorBedroom/state", "state_topic":"sensorBedroom/state",
"qos": 2, "qos": 2
} }
``` ```
@ -403,12 +403,12 @@ An empty config can be published as an update to remove a single component from
"mdl": "xya", "mdl": "xya",
"sw": "1.0", "sw": "1.0",
"sn": "ea334450945afc", "sn": "ea334450945afc",
"hw": "1.0rev2", "hw": "1.0rev2"
}, },
"o": { "o": {
"name":"bla2mqtt", "name":"bla2mqtt",
"sw": "2.1", "sw": "2.1",
"url": "https://bla2mqtt.example.com/support", "url": "https://bla2mqtt.example.com/support"
}, },
"cmps": { "cmps": {
"some_unique_component_id1": { "some_unique_component_id1": {
@ -416,14 +416,14 @@ An empty config can be published as an update to remove a single component from
"device_class":"temperature", "device_class":"temperature",
"unit_of_measurement":"°C", "unit_of_measurement":"°C",
"value_template":"{% raw %}{{ value_json.temperature}}{% endraw %}", "value_template":"{% raw %}{{ value_json.temperature}}{% endraw %}",
"unique_id":"temp01ae_t", "unique_id":"temp01ae_t"
}, },
"some_unique_id2": { "some_unique_id2": {
"p": "sensor", "p": "sensor"
} }
}, },
"state_topic":"sensorBedroom/state", "state_topic":"sensorBedroom/state",
"qos": 2, "qos": 2
} }
``` ```
@ -440,12 +440,12 @@ After removing a component, you should send another update with the removed comp
"mdl": "xya", "mdl": "xya",
"sw": "1.0", "sw": "1.0",
"sn": "ea334450945afc", "sn": "ea334450945afc",
"hw": "1.0rev2", "hw": "1.0rev2"
}, },
"o": { "o": {
"name":"bla2mqtt", "name":"bla2mqtt",
"sw": "2.1", "sw": "2.1",
"url": "https://bla2mqtt.example.com/support", "url": "https://bla2mqtt.example.com/support"
}, },
"cmps": { "cmps": {
"some_unique_component_id1": { "some_unique_component_id1": {
@ -453,11 +453,11 @@ After removing a component, you should send another update with the removed comp
"device_class":"temperature", "device_class":"temperature",
"unit_of_measurement":"°C", "unit_of_measurement":"°C",
"value_template":"{% raw %}{{ value_json.temperature}}{% endraw %}", "value_template":"{% raw %}{{ value_json.temperature}}{% endraw %}",
"unique_id":"temp01ae_t", "unique_id":"temp01ae_t"
} }
}, },
"state_topic":"sensorBedroom/state", "state_topic":"sensorBedroom/state",
"qos": 2, "qos": 2
} }
``` ```
@ -575,7 +575,7 @@ Discovery payload device:
"state_topic": "foobar/sensor/sensor1", "state_topic": "foobar/sensor/sensor1",
"unique_id": "bla_sensor001" "unique_id": "bla_sensor001"
} }
}, }
} }
``` ```
@ -618,19 +618,19 @@ Example discovery payload:
"mdl": "xya", "mdl": "xya",
"sw": "1.0", "sw": "1.0",
"sn": "ea334450945afc", "sn": "ea334450945afc",
"hw": "1.0rev2", "hw": "1.0rev2"
}, },
"o": { "o": {
"name":"bla2mqtt", "name":"bla2mqtt",
"sw": "2.1", "sw": "2.1",
"url": "https://bla2mqtt.example.com/support", "url": "https://bla2mqtt.example.com/support"
}, },
"device_class":"temperature", "device_class":"temperature",
"unit_of_measurement":"°C", "unit_of_measurement":"°C",
"value_template":"{% raw %}{{ value_json.temperature}}{% endraw %}", "value_template":"{% raw %}{{ value_json.temperature}}{% endraw %}",
"unique_id":"temp01ae_t", "unique_id":"temp01ae_t",
"state_topic":"sensorBedroom/state", "state_topic":"sensorBedroom/state",
"qos": 2, "qos": 2
} }
``` ```
@ -1286,12 +1286,12 @@ Setting up a [light that takes JSON payloads](/integrations/light.mqtt/#json-sch
"mdl_id": "ABC123", "mdl_id": "ABC123",
"sw": "1.0", "sw": "1.0",
"sn": "ea334450945afc", "sn": "ea334450945afc",
"hw": "1.0rev2", "hw": "1.0rev2"
}, },
"o": { "o": {
"name":"bla2mqtt", "name":"bla2mqtt",
"sw": "2.1", "sw": "2.1",
"url": "https://bla2mqtt.example.com/support", "url": "https://bla2mqtt.example.com/support"
} }
} }
``` ```