Skip to content

add get-config and update-config commands#16

Open
wouterteepe wants to merge 1 commit intoSikerdebaard:mainfrom
wouterteepe:get_set_main_config
Open

add get-config and update-config commands#16
wouterteepe wants to merge 1 commit intoSikerdebaard:mainfrom
wouterteepe:get_set_main_config

Conversation

@wouterteepe
Copy link
Copy Markdown

The current codebase does not yet expose the endpoints /config for retrieval and modifications.

This patch addresses that, and adds

get-config
update-config

It exposes a wide collection of settings to be altered, including notably the "NightBoost" setpoint, and toggling the Azure connection.

The config object is quite big, to properly validate changes according to the scheme as exposed by the DUCO box, I have created a recursive validation function, as this is substantially more compact as compared to other solutions.

Please note the validation function also handles "Options" validation with square brackets [ ], as present in the following part of the response:

{
    'Ventilation': {
        'Calibration': {
            'PwmEhaCfg': {'Val': 62, 'Min': 0, 'Inc': 1, 'Max': 100},
            'EnableAutoCalib': {'Val': 0, 'Min': 0, 'Inc': 1, 'Max': 1},
            'CalibOnMan2': {'Val': 0, 'Min': 0, 'Inc': 1, 'Max': 1},
            'GroundBound': {'Val': 1, 'Min': 0, 'Inc': 1, 'Max': 1},
            'HeadCount': {'Val': 4, 'Options': [1, 2, 4]},
            'PwmInverted': {'Val': 0, 'Min': 0, 'Inc': 1, 'Max': 1}
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant