sensors: INA shunt set at runtime -- sensor set ina.shunt <mOhm>, kept in prefs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-12 13:58:39 +01:00
1 parent ad4f53016c
commit 507842cea2
12 files changed
+106 -7

No files matched your search

+4
View File
@@ -413,6 +413,10 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, char* command, char* re
const char *key = (num > 0) ? parts[0] : "";
const char *value = (num > 1) ? parts[1] : "null";
if (_sensors->setSettingValue(key, value)) {
if (strcmp(key, "ina.shunt") == 0) { // CUSTOM (TeTeHacko): survives a reboot
_prefs->ina_shunt_mohm = atof(value);
savePrefs();
}
strcpy(reply, "ok");
} else {
strcpy(reply, "can't find custom var");