Add Wi-Fi next-profile rotation control
This commit is contained in:
@@ -80,6 +80,7 @@ typedef enum {
|
||||
LOCAL_STATUS_ACTION_SERIAL = 0,
|
||||
LOCAL_STATUS_ACTION_WIFI_POWER,
|
||||
LOCAL_STATUS_ACTION_WIFI_RECONNECT,
|
||||
LOCAL_STATUS_ACTION_WIFI_NEXT_PROFILE,
|
||||
LOCAL_STATUS_ACTION_WEB,
|
||||
LOCAL_STATUS_ACTION_SSH,
|
||||
LOCAL_STATUS_ACTION_REVOKE_WRITER,
|
||||
@@ -695,6 +696,8 @@ static const char *action_label(local_status_action_t action,
|
||||
return snapshot->wifi_available && snapshot->wifi.started ? "WiFi:stop" : "WiFi:start";
|
||||
case LOCAL_STATUS_ACTION_WIFI_RECONNECT:
|
||||
return "WiFi:reconnect";
|
||||
case LOCAL_STATUS_ACTION_WIFI_NEXT_PROFILE:
|
||||
return "WiFi:next profile";
|
||||
case LOCAL_STATUS_ACTION_WEB:
|
||||
return snapshot->web_available && snapshot->web.running ? "HTTPS:stop" : "HTTPS:start";
|
||||
case LOCAL_STATUS_ACTION_SSH:
|
||||
@@ -736,6 +739,8 @@ static const char *confirmed_action_label(const local_status_ui_state_t *state)
|
||||
return state->confirmed_stop ? "WiFi:stop" : "WiFi:start";
|
||||
case LOCAL_STATUS_ACTION_WIFI_RECONNECT:
|
||||
return "WiFi:reconnect";
|
||||
case LOCAL_STATUS_ACTION_WIFI_NEXT_PROFILE:
|
||||
return "WiFi:next profile";
|
||||
case LOCAL_STATUS_ACTION_WEB:
|
||||
return state->confirmed_stop ? "HTTPS:stop" : "HTTPS:start";
|
||||
case LOCAL_STATUS_ACTION_SSH:
|
||||
@@ -760,6 +765,7 @@ static bool action_requires_confirmation(local_status_action_t action,
|
||||
case LOCAL_STATUS_ACTION_WIFI_POWER:
|
||||
return snapshot->wifi_available && snapshot->wifi.started;
|
||||
case LOCAL_STATUS_ACTION_WIFI_RECONNECT:
|
||||
case LOCAL_STATUS_ACTION_WIFI_NEXT_PROFILE:
|
||||
return true;
|
||||
case LOCAL_STATUS_ACTION_WEB:
|
||||
return snapshot->web_available && snapshot->web.running;
|
||||
@@ -1047,6 +1053,12 @@ static void execute_action(local_status_ui_state_t *state,
|
||||
: ESP_ERR_INVALID_STATE;
|
||||
requested = error == ESP_OK;
|
||||
break;
|
||||
case LOCAL_STATUS_ACTION_WIFI_NEXT_PROFILE:
|
||||
error = snapshot->wifi_available && snapshot->wifi.started
|
||||
? wifi_manager_next_profile()
|
||||
: ESP_ERR_INVALID_STATE;
|
||||
requested = error == ESP_OK;
|
||||
break;
|
||||
case LOCAL_STATUS_ACTION_WEB:
|
||||
if (!snapshot->web_available || snapshot->web.running != state->confirmed_stop) {
|
||||
error = ESP_ERR_INVALID_STATE;
|
||||
|
||||
Reference in New Issue
Block a user