Controller settings commands

Controller settings

Feature Type Possible values Default value Description
scale.temperature token celsius, fahrenheit fahrenheit Current scale for temperature values.
time.format token 12, 24 12 Current format for time.
date.format token mmddyy, ddmmyy mmddyy Current format for date.
logs.severity token ERROR, WARNING, INFO, DEBUG, TRACE INFO Current severity level of log messages to log.
logs.color bool true, false false If true, the hub is allowed to print coloured log messages.
logs.indent token -1, 2, 4, 8 -1 Current indentation value for JSON printing in log messages.

hub.settings.list

Connection type: ANY

Ask controller to send a list of its settings

request:

Field Type Required Description
names array of strings - Return only specified settings, if not specified - return all settings

response:

Field Type Required Description
settings array of objects + Controller settings
settings.[].name string + Type of value: bool, token, string, int
settings.[].valueType string + Feature status
settings.[].enum array of strings - List of possible token values
settings.[].value depends on valueType + Current value

Example

request:

{
    "method": "hub.settings.list",
    "id": "_ID_",
    "params": {}
}

response:

{
    "error": null,
    "id": "_ID_",
    "method": "hub.settings.list",
    "result": {
        "settings": [
            {
                "enum": [
                    "mmddyy",
                    "ddmmyy"
                ],
                "name": "date.format",
                "value": "mmddyy",
                "valueType": "token"
            },
            {
                "name": "first_start",
                "value": true,
                "valueType": "bool"
            },
            {
                "enum": [
                    "celsius",
                    "fahrenheit"
                ],
                "name": "scale.temperature",
                "value": "fahrenheit",
                "valueType": "token"
            },
            {
                "enum": [
                    "12",
                    "24"
                ],
                "name": "time.format",
                "value": "12",
                "valueType": "token"
            },
            {
                "enum": [
                    "ERROR", "WARNING", "INFO", "DEBUG", "TRACE"
                ],
                "name": "logs.level",
                "value": "INFO",
                "valueType": "token"
            },
            {
                "name": "logs.color",
                "value": false,
                "valueType": "bool"
            },
            {
                "enum": [
                    "-1", "2", "4", "8"
                ],
                "name": "logs.indent",
                "value": "-1",
                "valueType": "token"
            }
        ]
    }
}

errors:

none


hub.setting.value.set

Connection type: ANY

Set value of specified controller setting

request:

Field Type Required Description
name string + Setting name
value depends on setting valueType + Setting value

response:

empty result

errors:

Code Message Data
-32600 Bad request, does not exist rpc.params.notfound.
-32500 Object not found generic.object.not.found
-32602 Value is not in valid range rpc.params.range.invalid.status

broadcasts:

Broadcast Description
hub.setting.updated Broadcast is sent if value was updated

Example

request:

‚Äč```json { "method": "hub.setting.value.set", "id": "ID", "params": { "name": "first_start", "value": false } }


**response**:

```json
{
    "error": null,
    "id": "_ID_",
    "method": "hub.setting.value.set",
    "result": {}
}

broadcast:

{
    "id": "ui_broadcast",
    "msg_subclass": "hub.setting.updated",
    "result": {
        "name": "first_start",
        "value": false
    }
}