mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[miio] Fix handling commands with curly brackets (#8897)
Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
parent
74ee8e76cf
commit
9a5832a2ee
@ -209,9 +209,11 @@ public abstract class MiIoAbstractHandler extends BaseThingHandler implements Mi
|
||||
try {
|
||||
String command = commandString.trim();
|
||||
String param = "[]";
|
||||
int loc = command.indexOf("[");
|
||||
loc = (loc > 0 ? loc : command.indexOf("{"));
|
||||
if (loc > 0) {
|
||||
int sb = command.indexOf("[");
|
||||
int cb = command.indexOf("{");
|
||||
logger.debug("locs {}, {}", sb, cb);
|
||||
if (Math.max(sb, cb) > 0) {
|
||||
int loc = (Math.min(sb, cb) > 0 ? Math.min(sb, cb) : Math.max(sb, cb));
|
||||
param = command.substring(loc).trim();
|
||||
command = command.substring(0, loc).trim();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user