From 2479529eab5736856bb09bcb917609527792812b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20L=27hopital?= Date: Mon, 29 Apr 2024 18:23:47 +0200 Subject: [PATCH] Fix error introduced in #16681 (#16703) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gaƫl L'hopital Signed-off-by: Ciprian Pascu --- .../handler/capability/HomeSecurityThingCapability.java | 4 ++-- .../handler/channelhelper/EventCameraChannelHelper.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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);