diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/capability/HomeSecurityThingCapability.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/capability/HomeSecurityThingCapability.java index 293d7ff349c..6ceb5b661b4 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/capability/HomeSecurityThingCapability.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/capability/HomeSecurityThingCapability.java @@ -43,8 +43,8 @@ public class HomeSecurityThingCapability extends Capability { List channelHelpers) { super(handler); this.descriptionProvider = descriptionProvider; - this.eventHelper = (EventChannelHelper) channelHelpers.stream().filter(c -> c instanceof EventChannelHelper) - .findFirst().orElseThrow(() -> new IllegalArgumentException( + this.eventHelper = channelHelpers.stream().filter(EventChannelHelper.class::isInstance) + .map(EventChannelHelper.class::cast).findFirst().orElseThrow(() -> new IllegalArgumentException( "HomeSecurityThingCapability must find an EventChannelHelper, please file a bug report.")); eventHelper.setModuleType(moduleType); } diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/channelhelper/EventCameraChannelHelper.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/channelhelper/EventCameraChannelHelper.java index c482a39e591..6348ea1d451 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/channelhelper/EventCameraChannelHelper.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/channelhelper/EventCameraChannelHelper.java @@ -30,7 +30,7 @@ import org.openhab.core.types.State; * */ @NonNullByDefault -public class EventCameraChannelHelper extends ChannelHelper { +public class EventCameraChannelHelper extends EventChannelHelper { public EventCameraChannelHelper(Set providedGroups) { super(providedGroups);