Skip to content

Commit

Permalink
Bug fix for JSON rules notification action
Browse files Browse the repository at this point in the history
  • Loading branch information
richturner committed Jan 27, 2020
1 parent 0b9d6c9 commit 7e86a26
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ public void operationComplete(ChannelFuture future) {
// Add closed callback
channel.closeFuture().addListener(future -> {
if (connectionStatus != ConnectionStatus.DISCONNECTING && connectionStatus != ConnectionStatus.DISCONNECTED) {
LOG.info("Connection closed: " + getClientUri());
scheduleReconnect();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@

import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Envelope;
import net.fortuna.ical4j.filter.PeriodRule;
import net.fortuna.ical4j.model.*;
import net.fortuna.ical4j.model.component.VEvent;
import net.fortuna.ical4j.model.property.RRule;
import org.geotools.referencing.GeodeticCalculator;
import org.openremote.container.timer.TimerService;
import org.openremote.manager.asset.AssetStorageService;
Expand Down Expand Up @@ -556,7 +553,7 @@ public static Predicate<Meta> asPredicate(Supplier<Long> currentMillisProducer,
}

public static Predicate<AssetState> asPredicate(Supplier<Long> currentMillisProducer, LogicGroup<AttributePredicate> condition) {
if (conditionIsEmpty(condition)) {
if (groupIsEmpty(condition)) {
return as -> true;
}

Expand Down Expand Up @@ -586,7 +583,7 @@ public static Predicate<AssetState> asPredicate(Supplier<Long> currentMillisProd
return asPredicate(assetStatePredicates, operator);
}

protected static boolean conditionIsEmpty(LogicGroup condition) {
protected static boolean groupIsEmpty(LogicGroup condition) {
return condition.getItems().size() == 0
&& (condition.groups == null || condition.groups.isEmpty());
}
Expand Down
Loading

0 comments on commit 7e86a26

Please sign in to comment.