]> git.basschouten.com Git - openhab-addons.git/commitdiff
[remoteopenhab] Avoid unexpected log for ALIVE SSE message (#13008)
authorlolodomo <lg.hc@free.fr>
Mon, 27 Jun 2022 16:25:00 +0000 (18:25 +0200)
committerGitHub <noreply@github.com>
Mon, 27 Jun 2022 16:25:00 +0000 (18:25 +0200)
Related to openhab/openhab-core#2983

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/rest/RemoteopenhabRestClient.java

index f0a4b4573dd1824b955eb3e8579e07f17ad36f43..c19a6335e06eec586cbc8f70fec3f56b9bf6ba1a 100644 (file)
@@ -401,13 +401,16 @@ public class RemoteopenhabRestClient {
             listeners.forEach(listener -> listener.onConnected());
         }
 
-        if (!"message".equals(name)) {
-            logger.debug("Received unhandled event with name '{}' and data '{}'", name, data);
-            return;
-        }
-
         try {
             RemoteopenhabEvent event = jsonParser.fromJson(data, RemoteopenhabEvent.class);
+            if ("ALIVE".equals(event.type)) {
+                // ignore ALIVE message
+                return;
+            }
+            if (!"message".equals(name)) {
+                logger.debug("Received unhandled event with name '{}' and data '{}'", name, data);
+                return;
+            }
             String itemName;
             String thingUID;
             RemoteopenhabEventPayload payload;