Skip to content

Commit

Permalink
[remoteopenhab] Optimize filtering of ALIVE events (openhab#13432)
Browse files Browse the repository at this point in the history
* [remoteopenhab] Optimize handling of ALIVE events

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo authored and nemerdaud committed Feb 28, 2023
1 parent 1817909 commit fc239ed
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,17 +400,13 @@ private void onEvent(InboundSseEvent inboundEvent) {
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;
Expand Down

0 comments on commit fc239ed

Please sign in to comment.