We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ca26a0 commit baca36eCopy full SHA for baca36e
src/nodes/victron-virtual.js
@@ -812,7 +812,15 @@ module.exports = function (RED) {
812
ifaceDesc.properties[key] = { type, format, persist }
813
814
let propValue = value
815
- if (name === 'Name') propValue = `Switch ${i}`
+ if (name === 'Name') {
816
+ // Find the format function for Settings/Type
817
+ const typeProp = baseProperties.find(p => p.name === 'Settings/Type');
818
+ let typeLabel = `Switch ${i}`;
819
+ if (typeProp && typeof typeProp.format === 'function') {
820
+ typeLabel = typeProp.format(switchType);
821
+ }
822
+ propValue = typeLabel;
823
824
if (name === 'Settings/Type') propValue = switchType
825
826
iface[key] = propValue !== undefined ? propValue : 0
0 commit comments