You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The mapping filename (within the `transform` folder) has to be set in the `function` parameter.
61
70
The parameter `sourceFormat` is optional and can be used to format the input value **before** the transformation, i.e. `%.3f`.
62
71
If omitted the default is `%s`, so the input value will be put into the transformation without any format changes.
63
72
64
73
Please note: This profile is a one-way transformation, i.e. only values from a device towards the item are changed, the other direction is left untouched.
Copy file name to clipboardExpand all lines: bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/MapTransformationService.java
+8-4
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,8 @@
20
20
importjava.util.Locale;
21
21
importjava.util.Map;
22
22
importjava.util.Map.Entry;
23
+
importjava.util.Objects;
24
+
importjava.util.Optional;
23
25
importjava.util.Properties;
24
26
importjava.util.Set;
25
27
importjava.util.concurrent.ConcurrentHashMap;
@@ -60,7 +62,9 @@ public class MapTransformationService
profile.config.transform.MAP.function.description = Filename containing the mapping information.
10
+
profile.config.transform.MAP.function.description = Filename containing the mapping information.<br /><br />Inline map is supported, e.g. "|online=ON;offline=OFF".<br /><br />The inline map entries are delimited with semicolons ("<code>;</code>") by default. <br /> To use a different delimiter, for example a comma: "<code>|?delimiter=,;online=ON,offline=OFF</code>" <br /> To use "<code>?delimiter</code>" as an actual map key, do not place it at the beginning of the map.
6
11
profile.config.transform.MAP.sourceFormat.label = State Formatter
7
12
profile.config.transform.MAP.sourceFormat.description = How to format the state on the channel before transforming it, i.e. %s or %.1f °C (default is %s).
Copy file name to clipboardExpand all lines: bundles/org.openhab.transform.map/src/test/java/org/openhab/transform/map/internal/MapTransformationServiceTest.java
+18-6
Original file line number
Diff line number
Diff line change
@@ -159,12 +159,6 @@ public void oneLineInlineMapTest() throws TransformationException {
0 commit comments