Skip to content

Commit 6dd70d8

Browse files
committed
Merge branch 'main' into fileformat_api_for_ui
2 parents 7b6218b + 3af47e9 commit 6dd70d8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bundles/org.openhab.core.model.thing/src/org/openhab/core/model/thing/internal/fileconverter/DslThingFileConverter.java

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.io.ByteArrayOutputStream;
1717
import java.io.IOException;
1818
import java.io.OutputStream;
19+
import java.math.BigDecimal;
1920
import java.util.HashSet;
2021
import java.util.List;
2122
import java.util.Set;
@@ -192,6 +193,12 @@ private ModelChannel buildModelChannel(Channel channel, boolean hideDefaultParam
192193
} else {
193194
property = null;
194195
}
196+
} else if (value instanceof Double doubleValue) {
197+
// DSL thing syntax does not like a configuration parameter value provided as Double type.
198+
// By security, we apply a conversion to a BigDecimal in case this would happen.
199+
logger.debug("Configuration parameter {} with value {} is provided unexpectedly as Double type", key,
200+
value);
201+
property.getValue().add(BigDecimal.valueOf(doubleValue));
195202
} else {
196203
property.getValue().add(value);
197204
}

0 commit comments

Comments
 (0)