]> git.basschouten.com Git - openhab-addons.git/commitdiff
[miio] sending device in MiIoSendCommand (#11475)
authorMarcel <marcel@verpaalen.com>
Sun, 31 Oct 2021 11:41:40 +0000 (12:41 +0100)
committerGitHub <noreply@github.com>
Sun, 31 Oct 2021 11:41:40 +0000 (12:41 +0100)
* [miio] sending device in MiIoSendCommand

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
* [miio] spotless reformatting

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoSendCommand.java
bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/transport/MiIoAsyncCommunication.java

index 4fac814dfcb6554cd1e94738b20582af51114d62..b26bd251d11feb79f9e74709d178ebe927e38250 100644 (file)
@@ -30,6 +30,7 @@ public class MiIoSendCommand {
     private final int id;
     private final MiIoCommand command;
     private final JsonObject commandJson;
+    private final String sender;
     private @Nullable JsonObject response;
     private String cloudServer = "";
 
@@ -37,17 +38,19 @@ public class MiIoSendCommand {
         this.response = response;
     }
 
-    public MiIoSendCommand(int id, MiIoCommand command, JsonObject fullCommand) {
+    public MiIoSendCommand(int id, MiIoCommand command, JsonObject fullCommand, String sender) {
         this.id = id;
         this.command = command;
         this.commandJson = fullCommand;
+        this.sender = sender;
     }
 
-    public MiIoSendCommand(int id, MiIoCommand command, JsonObject fullCommand, String cloudServer) {
+    public MiIoSendCommand(int id, MiIoCommand command, JsonObject fullCommand, String cloudServer, String sender) {
         this.id = id;
         this.command = command;
         this.commandJson = fullCommand;
         this.cloudServer = cloudServer;
+        this.sender = sender;
     }
 
     public int getId() {
@@ -102,4 +105,8 @@ public class MiIoSendCommand {
     public void setCloudServer(String cloudServer) {
         this.cloudServer = cloudServer;
     }
+
+    public String getSender() {
+        return sender;
+    }
 }
index 15c710300bba9c76cfb4953aa282e406fb62892b..1bb9018b4a92cf9a88de14d5cdda396aff4212f6 100644 (file)
@@ -148,7 +148,7 @@ public class MiIoAsyncCommunication {
                 fullCommand.add("params", JsonParser.parseString(params));
             }
             MiIoSendCommand sendCmd = new MiIoSendCommand(cmdId, MiIoCommand.getCommand(command), fullCommand,
-                    cloudServer);
+                    cloudServer, sender);
             concurrentLinkedQueue.add(sendCmd);
             if (logger.isDebugEnabled()) {
                 // Obfuscate part of the token to allow sharing of the logfiles