Minimize contract, add ADC read and send its data to coonsole

This commit is contained in:
2026-04-13 00:04:48 +03:00
parent 732a2dfa32
commit 977227296e
12 changed files with 269 additions and 67 deletions

View File

@@ -1,46 +1,44 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "contract/ingest/telemetry.schema.json",
"allOf": [
{ "$ref": "contract/ingest/common.schema.json" },
{
"type": "object",
"properties": {
"payload": {
"type": "object",
"required": ["measurements"],
"additionalProperties": false,
"properties": {
"measurements": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["metric", "value"],
"additionalProperties": false,
"properties": {
"metric": {
"type": "string",
"minLength": 1
},
"value": {
"type": ["number", "string", "boolean"]
},
"unit": {
"type": "string"
},
"source": {
"type": "string"
},
"ts": {
"type": "integer"
}
}
}
}
"type": "object",
"required": ["m", "s", "u", "v"],
"additionalProperties": false,
"properties": {
"m": {
"type": "string",
"minLength": 1,
"description": "Metric type (e.g. t=temperature, h=humidity)"
},
"s": {
"type": "string",
"minLength": 1,
"description": "Source identifier (sensor/channel)"
},
"u": {
"type": "string",
"minLength": 1,
"description": "Unit (e.g. c, pct, v)"
},
"v": {
"type": "array",
"minItems": 1,
"items": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": [
{
"type": "integer",
"minimum": 0,
"description": "Delta time (seconds) from base ts"
},
{
"type": "number",
"description": "Measured value"
}
}
]
}
}
]
}
}