Skip to content

Commit

Permalink
Fix displaying of Mercury 230 in config of wb-mqtt-serial (#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
KraPete authored Dec 12, 2024
1 parent f8ec66b commit beb764f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> 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
Expand Down

0 comments on commit beb764f

Please sign in to comment.