From beb764f9c35aeec6584d59b4759fc6ec2278269c Mon Sep 17 00:00:00 2001 From: KraPete <86825564+KraPete@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:58:42 +0500 Subject: [PATCH] Fix displaying of Mercury 230 in config of wb-mqtt-serial (#675) --- .../config-editor/configEditorPageStore.js | 15 +++++++++++++-- debian/changelog | 6 ++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/scripts/react-directives/device-manager/config-editor/configEditorPageStore.js b/app/scripts/react-directives/device-manager/config-editor/configEditorPageStore.js index a0a8ec79..bbed1cf0 100644 --- a/app/scripts/react-directives/device-manager/config-editor/configEditorPageStore.js +++ b/app/scripts/react-directives/device-manager/config-editor/configEditorPageStore.js @@ -220,6 +220,13 @@ function getTopics(portTabs, deviceTypesStore) { return topics; } +function getDeviceTypeFromConfig(deviceConfig) { + if (deviceConfig?.device_type) { + return deviceConfig.device_type; + } + return 'protocol:' + (deviceConfig?.protocol || 'modbus'); +} + class ConfigEditorPageStore { constructor( loadConfigFn, @@ -284,8 +291,12 @@ class ConfigEditorPageStore { } createDeviceTab(deviceConfig) { - const deviceType = deviceConfig?.device_type || deviceConfig?.protocol || 'modbus'; - return new DeviceTab(deviceConfig, deviceType, this.deviceTypesStore, this.fwUpdateProxy); + return new DeviceTab( + deviceConfig, + getDeviceTypeFromConfig(deviceConfig), + this.deviceTypesStore, + this.fwUpdateProxy + ); } createSettingsTab(config, schema) { diff --git a/debian/changelog b/debian/changelog index 39bd94bd..083232fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +wb-mqtt-homeui (2.107.0) stable; urgency=medium + + * Fix displaying of Mercury 230 devices in config of wb-mqtt-serial + + -- Petr Krasnoshchekov Wed, 11 Dec 2024 12:58:04 +0500 + wb-mqtt-homeui (2.106.3) stable; urgency=medium * Fix displaying of WB-MIO firmware update progress