{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "bluetti-field",
    "type": "object",
    "title": "Field schema",
    "properties": {
        "name": {
            "$ref": "https://bluetti-community.github.io/bluetti-registers/field-name.json"
        },
        "address": {
            "type": "integer",
            "title": "Field address"
        },
        "content": {
            "$ref": "https://bluetti-community.github.io/bluetti-registers/field-type.json"
        },
        "length": {
            "type": "integer",
            "title": "Data length if not set by content type",
            "minimum": 1
        },
        "options": {
            "$ref": "https://bluetti-community.github.io/bluetti-registers/field-enum.json"
        },
        "unit": {
            "type": "string",
            "title": "Measurement unit"
        },
        "scale": {
            "type": "number",
            "title": "Scale for fields (multiplies with value)"
        },
        "offset": {
            "type": "number",
            "title": "Offset for fields (added to the value after scale)"
        },
        "num_min": {
            "type": "integer",
            "title": "Minimum for numeric fields"
        },
        "num_max": {
            "type": "integer",
            "title": "Maximum for numeric fields"
        },
        "writable": {
            "type": "boolean",
            "title": "Set to true if field is writeable"
        },
        "category": {
            "$ref": "https://bluetti-community.github.io/bluetti-registers/field-category.json"
        },
        "state_class": {
            "$ref": "https://bluetti-community.github.io/bluetti-registers/field-state-class.json"
        },
        "device_class": {
            "$ref": "https://bluetti-community.github.io/bluetti-registers/field-device-class.json"
        }
    },
    "required": [
        "name",
        "address",
        "content"
    ]
}