From bbf4431b5f4c553dd66796f769ba2218cbb0b30e Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sat, 28 Jan 2023 15:15:21 +0100 Subject: [PATCH] allow change customization device without reboot --- interface/src/project/SettingsCustomization.tsx | 1 + src/web/WebCustomizationService.cpp | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/project/SettingsCustomization.tsx b/interface/src/project/SettingsCustomization.tsx index 777e3c734..37130fbad 100644 --- a/interface/src/project/SettingsCustomization.tsx +++ b/interface/src/project/SettingsCustomization.tsx @@ -244,6 +244,7 @@ const SettingsCustomization: FC = () => { const selected_device = parseInt(event.target.value, 10); setSelectedDevice(selected_device); fetchDeviceEntities(devices?.devices[selected_device].i); + setRestartNeeded(false); } }; diff --git a/src/web/WebCustomizationService.cpp b/src/web/WebCustomizationService.cpp index 39efe4ccf..06141f735 100644 --- a/src/web/WebCustomizationService.cpp +++ b/src/web/WebCustomizationService.cpp @@ -269,8 +269,7 @@ void WebCustomizationService::custom_entities(AsyncWebServerRequest * request, J bool is_set = false; for (const JsonVariant id : entity_ids_json) { std::string id_s = id.as(); - id_s = DeviceValue::get_name(id_s); - if (id_s == name) { + if (name == DeviceValue::get_name(id_s)) { is_set = true; need_reboot = true; break;