From 24ab2952ee50dc6bd13bf96eafc3584531631cb2 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Mon, 19 May 2025 16:53:08 -0400 Subject: [PATCH] Add unambiguous usermod list to info Neither the info panel nor the settings dialog can be trusted to accurately report the usermod list: - Not all usermods necessarily add to the info panel - Not all usermods necessarily add to the config page - #4609 is required for the config page to be correct Add a short list to the info object that lists the loaded usermod IDs. This is not displayed via the UI, but can be queried with curl or web debug tools. To be removed when usermod loading is working well. --- wled00/um_manager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wled00/um_manager.cpp b/wled00/um_manager.cpp index 9bfb7e737..1a7cc2269 100644 --- a/wled00/um_manager.cpp +++ b/wled00/um_manager.cpp @@ -39,7 +39,13 @@ bool UsermodManager::getUMData(um_data_t **data, uint8_t mod_id) { return false; } void UsermodManager::addToJsonState(JsonObject& obj) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->addToJsonState(obj); } -void UsermodManager::addToJsonInfo(JsonObject& obj) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->addToJsonInfo(obj); } +void UsermodManager::addToJsonInfo(JsonObject& obj) { + auto um_id_list = obj.createNestedArray("um"); + for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) { + um_id_list.add((*mod)->getId()); + (*mod)->addToJsonInfo(obj); + } +} void UsermodManager::readFromJsonState(JsonObject& obj) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->readFromJsonState(obj); } void UsermodManager::addToConfig(JsonObject& obj) { for (auto mod = _usermod_table_begin; mod < _usermod_table_end; ++mod) (*mod)->addToConfig(obj); } bool UsermodManager::readFromConfig(JsonObject& obj) {