From cba49df16a0b87551ee301556e0e55a7726df57b Mon Sep 17 00:00:00 2001 From: lolodomo Date: Tue, 22 Jun 2021 10:38:15 +0200 Subject: [PATCH] Added support for publishing ChannelDescriptionChangedEvents (#10896) Pack 2 Signed-off-by: Laurent Garnier --- .../BMWConnectedDriveOptionProvider.java | 17 +++++++++-------- ...IntesisDynamicStateDescriptionProvider.java | 13 +++++++++++++ ...pCameraDynamicStateDescriptionProvider.java | 8 +++++++- .../StateDescriptionOptionsProvider.java | 17 +++++++++-------- .../ResolStateDescriptionOptionProvider.java | 18 ++++++++++-------- .../RokuStateDescriptionOptionProvider.java | 17 +++++++++-------- .../WindDirectionStateDescriptionProvider.java | 14 ++++++++++++++ ...yMyLinkStateDescriptionOptionsProvider.java | 17 +++++++++-------- ...eezeBoxStateDescriptionOptionsProvider.java | 9 +++++++-- .../VehicleStateDescriptionProvider.java | 17 +++++++++-------- .../WledDynamicStateDescriptionProvider.java | 8 +++++++- .../ZmStateDescriptionOptionsProvider.java | 9 +++++++-- 12 files changed, 110 insertions(+), 54 deletions(-) diff --git a/bundles/org.openhab.binding.bmwconnecteddrive/src/main/java/org/openhab/binding/bmwconnecteddrive/internal/handler/BMWConnectedDriveOptionProvider.java b/bundles/org.openhab.binding.bmwconnecteddrive/src/main/java/org/openhab/binding/bmwconnecteddrive/internal/handler/BMWConnectedDriveOptionProvider.java index 82690ea67..95cc2d46f 100644 --- a/bundles/org.openhab.binding.bmwconnecteddrive/src/main/java/org/openhab/binding/bmwconnecteddrive/internal/handler/BMWConnectedDriveOptionProvider.java +++ b/bundles/org.openhab.binding.bmwconnecteddrive/src/main/java/org/openhab/binding/bmwconnecteddrive/internal/handler/BMWConnectedDriveOptionProvider.java @@ -13,9 +13,12 @@ package org.openhab.binding.bmwconnecteddrive.internal.handler; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @@ -28,14 +31,12 @@ import org.osgi.service.component.annotations.Reference; @NonNullByDefault public class BMWConnectedDriveOptionProvider extends BaseDynamicStateDescriptionProvider { - @Reference - protected void setChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + @Activate + public BMWConnectedDriveOptionProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // + final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; } - - protected void unsetChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { - this.channelTypeI18nLocalizationService = null; - } } diff --git a/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/IntesisDynamicStateDescriptionProvider.java b/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/IntesisDynamicStateDescriptionProvider.java index adfbb954b..8fc714941 100644 --- a/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/IntesisDynamicStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/IntesisDynamicStateDescriptionProvider.java @@ -13,9 +13,14 @@ package org.openhab.binding.intesis.internal; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; +import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; /** * @@ -25,4 +30,12 @@ import org.osgi.service.component.annotations.Component; @NonNullByDefault public class IntesisDynamicStateDescriptionProvider extends BaseDynamicStateDescriptionProvider { + @Activate + public IntesisDynamicStateDescriptionProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // + final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; + this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; + } } diff --git a/bundles/org.openhab.binding.ipcamera/src/main/java/org/openhab/binding/ipcamera/internal/IpCameraDynamicStateDescriptionProvider.java b/bundles/org.openhab.binding.ipcamera/src/main/java/org/openhab/binding/ipcamera/internal/IpCameraDynamicStateDescriptionProvider.java index 3e1dd2d64..927ff9659 100644 --- a/bundles/org.openhab.binding.ipcamera/src/main/java/org/openhab/binding/ipcamera/internal/IpCameraDynamicStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.ipcamera/src/main/java/org/openhab/binding/ipcamera/internal/IpCameraDynamicStateDescriptionProvider.java @@ -13,8 +13,10 @@ package org.openhab.binding.ipcamera.internal; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; @@ -29,9 +31,13 @@ import org.osgi.service.component.annotations.Reference; @Component(service = { DynamicStateDescriptionProvider.class, IpCameraDynamicStateDescriptionProvider.class }) @NonNullByDefault public class IpCameraDynamicStateDescriptionProvider extends BaseDynamicStateDescriptionProvider { + @Activate - public IpCameraDynamicStateDescriptionProvider( + public IpCameraDynamicStateDescriptionProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; } } diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/StateDescriptionOptionsProvider.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/StateDescriptionOptionsProvider.java index 076fc40f3..ad61dd7c2 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/StateDescriptionOptionsProvider.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/StateDescriptionOptionsProvider.java @@ -13,9 +13,12 @@ package org.openhab.binding.lametrictime.internal; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @@ -28,14 +31,12 @@ import org.osgi.service.component.annotations.Reference; @NonNullByDefault public class StateDescriptionOptionsProvider extends BaseDynamicStateDescriptionProvider { - @Reference - protected void setChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + @Activate + public StateDescriptionOptionsProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // + final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; } - - protected void unsetChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { - this.channelTypeI18nLocalizationService = null; - } } diff --git a/bundles/org.openhab.binding.resol/src/main/java/org/openhab/binding/resol/internal/ResolStateDescriptionOptionProvider.java b/bundles/org.openhab.binding.resol/src/main/java/org/openhab/binding/resol/internal/ResolStateDescriptionOptionProvider.java index ad0955cad..360d99657 100644 --- a/bundles/org.openhab.binding.resol/src/main/java/org/openhab/binding/resol/internal/ResolStateDescriptionOptionProvider.java +++ b/bundles/org.openhab.binding.resol/src/main/java/org/openhab/binding/resol/internal/ResolStateDescriptionOptionProvider.java @@ -13,9 +13,12 @@ package org.openhab.binding.resol.internal; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @@ -27,14 +30,13 @@ import org.osgi.service.component.annotations.Reference; @Component(service = { DynamicStateDescriptionProvider.class, ResolStateDescriptionOptionProvider.class }) @NonNullByDefault public class ResolStateDescriptionOptionProvider extends BaseDynamicStateDescriptionProvider { - @Reference - protected void setChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + + @Activate + public ResolStateDescriptionOptionProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // + final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; } - - protected void unsetChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { - this.channelTypeI18nLocalizationService = null; - } } diff --git a/bundles/org.openhab.binding.roku/src/main/java/org/openhab/binding/roku/internal/RokuStateDescriptionOptionProvider.java b/bundles/org.openhab.binding.roku/src/main/java/org/openhab/binding/roku/internal/RokuStateDescriptionOptionProvider.java index fef93a40e..a0ee178de 100644 --- a/bundles/org.openhab.binding.roku/src/main/java/org/openhab/binding/roku/internal/RokuStateDescriptionOptionProvider.java +++ b/bundles/org.openhab.binding.roku/src/main/java/org/openhab/binding/roku/internal/RokuStateDescriptionOptionProvider.java @@ -13,9 +13,12 @@ package org.openhab.binding.roku.internal; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @@ -28,14 +31,12 @@ import org.osgi.service.component.annotations.Reference; @NonNullByDefault public class RokuStateDescriptionOptionProvider extends BaseDynamicStateDescriptionProvider { - @Reference - protected void setChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + @Activate + public RokuStateDescriptionOptionProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // + final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; } - - protected void unsetChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { - this.channelTypeI18nLocalizationService = null; - } } diff --git a/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/WindDirectionStateDescriptionProvider.java b/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/WindDirectionStateDescriptionProvider.java index 461cd093d..a97b8f8a4 100644 --- a/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/WindDirectionStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/WindDirectionStateDescriptionProvider.java @@ -13,9 +13,14 @@ package org.openhab.binding.sagercaster.internal; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; +import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; /** * Dynamic provider of state options for WindDirections. @@ -25,4 +30,13 @@ import org.osgi.service.component.annotations.Component; @NonNullByDefault @Component(service = { DynamicStateDescriptionProvider.class, WindDirectionStateDescriptionProvider.class }) public class WindDirectionStateDescriptionProvider extends BaseDynamicStateDescriptionProvider { + + @Activate + public WindDirectionStateDescriptionProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // + final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; + this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; + } } diff --git a/bundles/org.openhab.binding.somfymylink/src/main/java/org/openhab/binding/somfymylink/internal/handler/SomfyMyLinkStateDescriptionOptionsProvider.java b/bundles/org.openhab.binding.somfymylink/src/main/java/org/openhab/binding/somfymylink/internal/handler/SomfyMyLinkStateDescriptionOptionsProvider.java index 2a0ffcdd3..d34993382 100644 --- a/bundles/org.openhab.binding.somfymylink/src/main/java/org/openhab/binding/somfymylink/internal/handler/SomfyMyLinkStateDescriptionOptionsProvider.java +++ b/bundles/org.openhab.binding.somfymylink/src/main/java/org/openhab/binding/somfymylink/internal/handler/SomfyMyLinkStateDescriptionOptionsProvider.java @@ -13,9 +13,12 @@ package org.openhab.binding.somfymylink.internal.handler; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @@ -29,14 +32,12 @@ import org.osgi.service.component.annotations.Reference; @NonNullByDefault public class SomfyMyLinkStateDescriptionOptionsProvider extends BaseDynamicStateDescriptionProvider { - @Reference - protected void setChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + @Activate + public SomfyMyLinkStateDescriptionOptionsProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // + final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; } - - protected void unsetChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { - this.channelTypeI18nLocalizationService = null; - } } diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxStateDescriptionOptionsProvider.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxStateDescriptionOptionsProvider.java index 7db6f9745..1a5813d79 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxStateDescriptionOptionsProvider.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxStateDescriptionOptionsProvider.java @@ -13,8 +13,10 @@ package org.openhab.binding.squeezebox.internal; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; @@ -31,8 +33,11 @@ import org.osgi.service.component.annotations.Reference; public class SqueezeBoxStateDescriptionOptionsProvider extends BaseDynamicStateDescriptionProvider { @Activate - public SqueezeBoxStateDescriptionOptionsProvider( - @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + public SqueezeBoxStateDescriptionOptionsProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // + final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; } } diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleStateDescriptionProvider.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleStateDescriptionProvider.java index bf0632c82..d95b06c68 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleStateDescriptionProvider.java @@ -13,9 +13,12 @@ package org.openhab.binding.volvooncall.internal.handler; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @@ -29,14 +32,12 @@ import org.osgi.service.component.annotations.Reference; @NonNullByDefault public class VehicleStateDescriptionProvider extends BaseDynamicStateDescriptionProvider { - @Reference - protected void setChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + @Activate + public VehicleStateDescriptionProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // + final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; } - - protected void unsetChannelTypeI18nLocalizationService( - final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { - this.channelTypeI18nLocalizationService = null; - } } diff --git a/bundles/org.openhab.binding.wled/src/main/java/org/openhab/binding/wled/internal/WledDynamicStateDescriptionProvider.java b/bundles/org.openhab.binding.wled/src/main/java/org/openhab/binding/wled/internal/WledDynamicStateDescriptionProvider.java index 969649d3c..13a3d4b02 100644 --- a/bundles/org.openhab.binding.wled/src/main/java/org/openhab/binding/wled/internal/WledDynamicStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.wled/src/main/java/org/openhab/binding/wled/internal/WledDynamicStateDescriptionProvider.java @@ -13,8 +13,10 @@ package org.openhab.binding.wled.internal; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; @@ -29,9 +31,13 @@ import org.osgi.service.component.annotations.Reference; @Component(service = { DynamicStateDescriptionProvider.class, WledDynamicStateDescriptionProvider.class }) @NonNullByDefault public class WledDynamicStateDescriptionProvider extends BaseDynamicStateDescriptionProvider { + @Activate - public WledDynamicStateDescriptionProvider( + public WledDynamicStateDescriptionProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; } } diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZmStateDescriptionOptionsProvider.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZmStateDescriptionOptionsProvider.java index f1e6720b4..621eee3c9 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZmStateDescriptionOptionsProvider.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZmStateDescriptionOptionsProvider.java @@ -13,8 +13,10 @@ package org.openhab.binding.zoneminder.internal; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.events.EventPublisher; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; +import org.openhab.core.thing.link.ItemChannelLinkRegistry; import org.openhab.core.thing.type.DynamicStateDescriptionProvider; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; @@ -31,8 +33,11 @@ import org.osgi.service.component.annotations.Reference; public class ZmStateDescriptionOptionsProvider extends BaseDynamicStateDescriptionProvider { @Activate - public ZmStateDescriptionOptionsProvider( - @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + public ZmStateDescriptionOptionsProvider(final @Reference EventPublisher eventPublisher, // + final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, // + final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { + this.eventPublisher = eventPublisher; + this.itemChannelLinkRegistry = itemChannelLinkRegistry; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; } }