def reset(ctrl: Api = Depends(get_ctrl)) -> models.Status: """ Reload the current configuration, resetting the firmware in the process. """ ctrl.reinit(settings=ctrl._settings, change_notifier=notify_on_change) return ctrl.get_state()
def load_config(config: models.Status, ctrl: Api = Depends(get_ctrl)) -> models.Status: """ Load a new configuration (and return the configuration loaded). This will overwrite the current configuration so it is advised to save the previous config from. """ ctrl.reinit(settings=ctrl._settings, change_notifier=notify_on_change, config=config) return ctrl.get_state()