]> git.basschouten.com Git - openhab-addons.git/commitdiff
Fix error introduced in #16681 (#16703)
authorGaël L'hopital <gael@lhopital.org>
Mon, 29 Apr 2024 16:23:47 +0000 (18:23 +0200)
committerGitHub <noreply@github.com>
Mon, 29 Apr 2024 16:23:47 +0000 (18:23 +0200)
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/capability/HomeSecurityThingCapability.java
bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/channelhelper/EventCameraChannelHelper.java

index 293d7ff349cbce2dee904a9917c56fb3cb52f9e2..6ceb5b661b45e9732bff7dc19891cc9c0266097c 100644 (file)
@@ -43,8 +43,8 @@ public class HomeSecurityThingCapability extends Capability {
             List<ChannelHelper> 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);
     }
index c482a39e591ffe90972e0488679b633a9bddda91..6348ea1d45141d39f46739ef83127f9b86521955 100644 (file)
@@ -30,7 +30,7 @@ import org.openhab.core.types.State;
  *
  */
 @NonNullByDefault
-public class EventCameraChannelHelper extends ChannelHelper {
+public class EventCameraChannelHelper extends EventChannelHelper {
 
     public EventCameraChannelHelper(Set<String> providedGroups) {
         super(providedGroups);