@@ -1305,7 +1305,7 @@ SettingValueResponse updateSettingWithValue(bool inCommands, const char *setting
1305
1305
knownSetting = true ;
1306
1306
}
1307
1307
1308
- // Special actions
1308
+ // Special human-machine-interface commands/ actions
1309
1309
else if (strcmp (settingName, " enableRCFirmware" ) == 0 )
1310
1310
{
1311
1311
enableRCFirmware = settingValue;
@@ -1388,6 +1388,18 @@ SettingValueResponse updateSettingWithValue(bool inCommands, const char *setting
1388
1388
sendStringToWebsocket (settingsCSV);
1389
1389
knownSetting = true ;
1390
1390
}
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
+ }
1391
1403
else if (strcmp (settingName, " forgetEspNowPeers" ) == 0 )
1392
1404
{
1393
1405
// Forget all ESP-NOW Peers
@@ -2928,7 +2940,20 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
2928
2940
return (SETTING_KNOWN);
2929
2941
2930
2942
// 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 )
2932
2957
{
2933
2958
writeToString (settingValueStr, (char *)printDeviceId ());
2934
2959
knownSetting = true ;
0 commit comments