fix: customisable switch custom name not displayed (#5193)

This commit is contained in:
3djc
2024-06-18 10:24:42 +10:00
committed by GitHub
parent e7509349b3
commit e596fc5a47
+6 -1
View File
@@ -316,7 +316,12 @@ void switchSetCustomName(uint8_t idx, const char* str, size_t len)
const char* switchGetCustomName(uint8_t idx)
{
return _switchNames[idx];
#if defined(FUNCTION_SWITCHES)
if (idx >= switchGetMaxSwitches()) // Switch is a customisable switch
return g_model.switchNames[idx - switchGetMaxSwitches()];
else
#endif
return _switchNames[idx];
}
bool switchHasCustomName(uint8_t idx)