@@ -1305,7 +1305,7 @@ SettingValueResponse updateSettingWithValue(bool inCommands, const char *setting
13051305 knownSetting = true ;
13061306 }
13071307
1308- // Special actions
1308+ // Special human-machine-interface commands/ actions
13091309 else if (strcmp (settingName, " enableRCFirmware" ) == 0 )
13101310 {
13111311 enableRCFirmware = settingValue;
@@ -1388,6 +1388,18 @@ SettingValueResponse updateSettingWithValue(bool inCommands, const char *setting
13881388 sendStringToWebsocket (settingsCSV);
13891389 knownSetting = true ;
13901390 }
1391+
1392+ // Is this a profile name change request? ie, 'profile2Name'
1393+ // Search by first letter first to speed up search
1394+ else if ((settingName[0 ] == ' p' ) && (strstr (settingName, " profile" ) != nullptr ) && (strcmp (&settingName[8 ], " Name" ) == 0 ))
1395+ {
1396+ int profileNumber = settingName[7 ] - ' 0' ;
1397+ if (profileNumber >= 0 && profileNumber <= MAX_PROFILE_COUNT)
1398+ {
1399+ strncpy (profileNames[profileNumber], settingValueStr, sizeof (profileNames[0 ]));
1400+ knownSetting = true ;
1401+ }
1402+ }
13911403 else if (strcmp (settingName, " forgetEspNowPeers" ) == 0 )
13921404 {
13931405 // Forget all ESP-NOW Peers
@@ -2928,7 +2940,20 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
29282940 return (SETTING_KNOWN);
29292941
29302942 // Report special human-machine-interface settings
2931- if (strcmp (settingName, " deviceId" ) == 0 )
2943+
2944+ // Is this a profile name request? profile2Name
2945+ // Search by first letter first to speed up search
2946+ if ((settingName[0 ] == ' p' ) && (strstr (settingName, " profile" ) != nullptr ) && (strcmp (&settingName[8 ], " Name" ) == 0 ))
2947+ {
2948+ int profileNumber = settingName[7 ] - ' 0' ;
2949+ if (profileNumber >= 0 && profileNumber <= MAX_PROFILE_COUNT)
2950+ {
2951+ writeToString (settingValueStr, profileNames[profileNumber]);
2952+ knownSetting = true ;
2953+ settingIsString = true ;
2954+ }
2955+ }
2956+ else if (strcmp (settingName, " deviceId" ) == 0 )
29322957 {
29332958 writeToString (settingValueStr, (char *)printDeviceId ());
29342959 knownSetting = true ;
0 commit comments