[remoteopenhab] Optimize filtering of ALIVE events (#13432)

* [remoteopenhab] Optimize handling of ALIVE events

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2022-09-28 20:39:20 +02:00 committed by GitHub
parent 6069286ffd
commit d00ca1caeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -400,17 +400,13 @@ public class RemoteopenhabRestClient {
connected = true;
listeners.forEach(listener -> listener.onConnected());
}
if (!"message".equals(name)) {
// Ignore silently all events which are not "message" events. This includes the "alive" events.
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;