openHAB-Alignment-Tool icon indicating copy to clipboard operation
openHAB-Alignment-Tool copied to clipboard

Issue with escaped characters in item file

Open CWempe opened this issue 3 years ago • 3 comments

Found another bug.

This might be a tricky one, because it includes escaped characters.

Example:

String  AAA  "BBB"    {mqtt=">[mosquitto:ccc:command:open:{\"x\"\\: \"y\"}]"}

Result:

String  AAA  "BBB"  {mqtt=">[mosquitto:ccc:command:open:{\"}

And here is my real life example:

String  Therm_AZ_Preset  "AZ Preset"                 <thermostat>  (Thermostat)  {mqtt=">[mosquitto:zigbee2mqtt/Therm_AZ/set:command:schedule:{\"preset\"\\: \"schedule\"}],
                                                                                        >[mosquitto:zigbee2mqtt/Therm_AZ/set:command:manual:{\"preset\"\\: \"manual\"}],
                                                                                        >[mosquitto:zigbee2mqtt/Therm_AZ/set:command:boost:{\"preset\"\\: \"boost\"}],
                                                                                        >[mosquitto:zigbee2mqtt/Therm_AZ/set:command:complex:{\"preset\"\\: \"complex\"}],
                                                                                        >[mosquitto:zigbee2mqtt/Therm_AZ/set:command:comfort:{\"preset\"\\: \"comfort\"}],
                                                                                        >[mosquitto:zigbee2mqtt/Therm_AZ/set:command:eco:{\"preset\"\\: \"eco\"}],
                                                                                        <[mosquitto:zigbee2mqtt/Therm_AZ:state:JSONPATH($.preset)]"}

Addon version: 2.1.5

CWempe avatar Apr 27 '21 21:04 CWempe