From 32c26658110d8264904ed4f3ab73cfb05223414a Mon Sep 17 00:00:00 2001 From: Bob Eckhoff Date: Fri, 15 Nov 2024 09:34:07 -0500 Subject: [PATCH] New PR candidate Java doc and possible mdns discovery. Signed-off-by: Bob Eckhoff --- .../internal/MideaACConfiguration.java | 36 +++++++++++++++++++ .../connection/ConnectionManager.java | 1 + .../mideaac/internal/handler/Callback.java | 6 +++- .../src/main/resources/OH-INF/addon/addon.xml | 12 ++++++- 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/MideaACConfiguration.java b/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/MideaACConfiguration.java index b31abacacd0..9d1793056a9 100644 --- a/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/MideaACConfiguration.java +++ b/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/MideaACConfiguration.java @@ -23,28 +23,64 @@ import org.eclipse.jdt.annotation.NonNullByDefault; @NonNullByDefault public class MideaACConfiguration { + /** + * IP Address + */ public String ipAddress = ""; + /** + * IP Port + */ public int ipPort = 6444; + /** + * Device ID + */ public String deviceId = "0"; + /** + * Cloud Account email + */ public String email = ""; + /** + * Cloud Account Password + */ public String password = ""; + /** + * Cloud Provider + */ public String cloud = ""; + /** + * Token + */ public String token = ""; + /** + * Key + */ public String key = ""; + /** + * Poll Frequency + */ public int pollingTime = 60; + /** + * Socket Timeout + */ public int timeout = 4; + /** + * Prompt tone from indoor unit with a Set Command + */ public boolean promptTone = false; + /** + * AC Version + */ public int version = 0; /** diff --git a/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/connection/ConnectionManager.java b/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/connection/ConnectionManager.java index a8582127366..ab5b1893590 100644 --- a/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/connection/ConnectionManager.java +++ b/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/connection/ConnectionManager.java @@ -140,6 +140,7 @@ public class ConnectionManager { } retry = false; try { + socket.close(); socket = new Socket(); socket.setSoTimeout(timeout * 1000); socket.connect(new InetSocketAddress(ipAddress, ipPort), timeout * 1000); diff --git a/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/handler/Callback.java b/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/handler/Callback.java index 98f8464b3e0..7df25059185 100644 --- a/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/handler/Callback.java +++ b/bundles/org.openhab.binding.mideaac/src/main/java/org/openhab/binding/mideaac/internal/handler/Callback.java @@ -21,6 +21,10 @@ import org.eclipse.jdt.annotation.NonNullByDefault; */ @NonNullByDefault public interface Callback { - +/** + * Updates channels with the response + * + * @param response Byte response from the device used to update channels + */ void updateChannels(Response response); } diff --git a/bundles/org.openhab.binding.mideaac/src/main/resources/OH-INF/addon/addon.xml b/bundles/org.openhab.binding.mideaac/src/main/resources/OH-INF/addon/addon.xml index 4767a09ed31..1ee28925ed1 100644 --- a/bundles/org.openhab.binding.mideaac/src/main/resources/OH-INF/addon/addon.xml +++ b/bundles/org.openhab.binding.mideaac/src/main/resources/OH-INF/addon/addon.xml @@ -7,5 +7,15 @@ MideaAC Binding This is the binding for MideaAC. local - + + + mdns + + + mdnsServiceType + _mideaair._tcp.local. + + + +