Added support for publishing ChannelDescriptionChangedEvents (#10898)

Pack 3

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2021-06-22 21:21:40 +02:00 committed by GitHub
parent 34e26f806d
commit 0728e16335
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 74 additions and 64 deletions

View File

@ -13,9 +13,12 @@
package org.openhab.binding.bosesoundtouch.internal; package org.openhab.binding.bosesoundtouch.internal;
import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.events.EventPublisher;
import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider;
import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService;
import org.openhab.core.thing.link.ItemChannelLinkRegistry;
import org.openhab.core.thing.type.DynamicStateDescriptionProvider; 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.Component;
import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.Reference;
@ -28,14 +31,12 @@ import org.osgi.service.component.annotations.Reference;
@NonNullByDefault @NonNullByDefault
public class BoseStateDescriptionOptionProvider extends BaseDynamicStateDescriptionProvider { public class BoseStateDescriptionOptionProvider extends BaseDynamicStateDescriptionProvider {
@Reference @Activate
protected void setChannelTypeI18nLocalizationService( public BoseStateDescriptionOptionProvider(final @Reference EventPublisher eventPublisher, //
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, //
final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.eventPublisher = eventPublisher;
this.itemChannelLinkRegistry = itemChannelLinkRegistry;
this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService;
} }
protected void unsetChannelTypeI18nLocalizationService(
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.channelTypeI18nLocalizationService = null;
}
} }

View File

@ -13,9 +13,12 @@
package org.openhab.binding.daikin.internal; package org.openhab.binding.daikin.internal;
import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.events.EventPublisher;
import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider;
import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService;
import org.openhab.core.thing.link.ItemChannelLinkRegistry;
import org.openhab.core.thing.type.DynamicStateDescriptionProvider; 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.Component;
import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.Reference;
@ -28,14 +31,12 @@ import org.osgi.service.component.annotations.Reference;
@NonNullByDefault @NonNullByDefault
public class DaikinDynamicStateDescriptionProvider extends BaseDynamicStateDescriptionProvider { public class DaikinDynamicStateDescriptionProvider extends BaseDynamicStateDescriptionProvider {
@Reference @Activate
protected void setChannelTypeI18nLocalizationService( public DaikinDynamicStateDescriptionProvider(final @Reference EventPublisher eventPublisher, //
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, //
final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.eventPublisher = eventPublisher;
this.itemChannelLinkRegistry = itemChannelLinkRegistry;
this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService;
} }
protected void unsetChannelTypeI18nLocalizationService(
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.channelTypeI18nLocalizationService = null;
}
} }

View File

@ -13,9 +13,12 @@
package org.openhab.binding.hyperion.internal; package org.openhab.binding.hyperion.internal;
import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.events.EventPublisher;
import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider;
import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService;
import org.openhab.core.thing.link.ItemChannelLinkRegistry;
import org.openhab.core.thing.type.DynamicStateDescriptionProvider; 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.Component;
import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.Reference;
@ -30,14 +33,12 @@ import org.osgi.service.component.annotations.Reference;
@NonNullByDefault @NonNullByDefault
public class HyperionStateDescriptionProvider extends BaseDynamicStateDescriptionProvider { public class HyperionStateDescriptionProvider extends BaseDynamicStateDescriptionProvider {
@Reference @Activate
protected void setChannelTypeI18nLocalizationService( public HyperionStateDescriptionProvider(final @Reference EventPublisher eventPublisher, //
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, //
final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.eventPublisher = eventPublisher;
this.itemChannelLinkRegistry = itemChannelLinkRegistry;
this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService;
} }
protected void unsetChannelTypeI18nLocalizationService(
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.channelTypeI18nLocalizationService = null;
}
} }

View File

@ -13,9 +13,12 @@
package org.openhab.binding.monopriceaudio.internal; package org.openhab.binding.monopriceaudio.internal;
import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.events.EventPublisher;
import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider;
import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService;
import org.openhab.core.thing.link.ItemChannelLinkRegistry;
import org.openhab.core.thing.type.DynamicStateDescriptionProvider; 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.Component;
import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.Reference;
@ -28,14 +31,12 @@ import org.osgi.service.component.annotations.Reference;
@NonNullByDefault @NonNullByDefault
public class MonopriceAudioStateDescriptionOptionProvider extends BaseDynamicStateDescriptionProvider { public class MonopriceAudioStateDescriptionOptionProvider extends BaseDynamicStateDescriptionProvider {
@Reference @Activate
protected void setChannelTypeI18nLocalizationService( public MonopriceAudioStateDescriptionOptionProvider(final @Reference EventPublisher eventPublisher, //
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, //
final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.eventPublisher = eventPublisher;
this.itemChannelLinkRegistry = itemChannelLinkRegistry;
this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService;
} }
protected void unsetChannelTypeI18nLocalizationService(
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.channelTypeI18nLocalizationService = null;
}
} }

View File

@ -13,9 +13,12 @@
package org.openhab.binding.nuvo.internal; package org.openhab.binding.nuvo.internal;
import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.events.EventPublisher;
import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider;
import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService;
import org.openhab.core.thing.link.ItemChannelLinkRegistry;
import org.openhab.core.thing.type.DynamicStateDescriptionProvider; 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.Component;
import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.Reference;
@ -28,14 +31,12 @@ import org.osgi.service.component.annotations.Reference;
@NonNullByDefault @NonNullByDefault
public class NuvoStateDescriptionOptionProvider extends BaseDynamicStateDescriptionProvider { public class NuvoStateDescriptionOptionProvider extends BaseDynamicStateDescriptionProvider {
@Reference @Activate
protected void setChannelTypeI18nLocalizationService( public NuvoStateDescriptionOptionProvider(final @Reference EventPublisher eventPublisher, //
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, //
final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.eventPublisher = eventPublisher;
this.itemChannelLinkRegistry = itemChannelLinkRegistry;
this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService;
} }
protected void unsetChannelTypeI18nLocalizationService(
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.channelTypeI18nLocalizationService = null;
}
} }

View File

@ -13,9 +13,12 @@
package org.openhab.binding.oppo.internal; package org.openhab.binding.oppo.internal;
import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.events.EventPublisher;
import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider;
import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService;
import org.openhab.core.thing.link.ItemChannelLinkRegistry;
import org.openhab.core.thing.type.DynamicStateDescriptionProvider; 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.Component;
import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.Reference;
@ -28,14 +31,12 @@ import org.osgi.service.component.annotations.Reference;
@NonNullByDefault @NonNullByDefault
public class OppoStateDescriptionOptionProvider extends BaseDynamicStateDescriptionProvider { public class OppoStateDescriptionOptionProvider extends BaseDynamicStateDescriptionProvider {
@Reference @Activate
protected void setChannelTypeI18nLocalizationService( public OppoStateDescriptionOptionProvider(final @Reference EventPublisher eventPublisher, //
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, //
final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.eventPublisher = eventPublisher;
this.itemChannelLinkRegistry = itemChannelLinkRegistry;
this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService;
} }
protected void unsetChannelTypeI18nLocalizationService(
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.channelTypeI18nLocalizationService = null;
}
} }

View File

@ -13,9 +13,12 @@
package org.openhab.binding.pjlinkdevice.internal; package org.openhab.binding.pjlinkdevice.internal;
import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.events.EventPublisher;
import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider;
import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService;
import org.openhab.core.thing.link.ItemChannelLinkRegistry;
import org.openhab.core.thing.type.DynamicStateDescriptionProvider; 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.Component;
import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.Reference;
@ -27,14 +30,13 @@ import org.osgi.service.component.annotations.Reference;
@Component(service = { DynamicStateDescriptionProvider.class, InputChannelStateDescriptionProvider.class }) @Component(service = { DynamicStateDescriptionProvider.class, InputChannelStateDescriptionProvider.class })
@NonNullByDefault @NonNullByDefault
public class InputChannelStateDescriptionProvider extends BaseDynamicStateDescriptionProvider { public class InputChannelStateDescriptionProvider extends BaseDynamicStateDescriptionProvider {
@Reference
protected void setChannelTypeI18nLocalizationService( @Activate
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { public InputChannelStateDescriptionProvider(final @Reference EventPublisher eventPublisher, //
final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, //
final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.eventPublisher = eventPublisher;
this.itemChannelLinkRegistry = itemChannelLinkRegistry;
this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService;
} }
protected void unsetChannelTypeI18nLocalizationService(
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.channelTypeI18nLocalizationService = null;
}
} }

View File

@ -13,9 +13,12 @@
package org.openhab.binding.radiothermostat.internal; package org.openhab.binding.radiothermostat.internal;
import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.events.EventPublisher;
import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider; import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider;
import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService; import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService;
import org.openhab.core.thing.link.ItemChannelLinkRegistry;
import org.openhab.core.thing.type.DynamicStateDescriptionProvider; 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.Component;
import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.Reference;
@ -29,14 +32,13 @@ import org.osgi.service.component.annotations.Reference;
@Component(service = { DynamicStateDescriptionProvider.class, RadioThermostatStateDescriptionProvider.class }) @Component(service = { DynamicStateDescriptionProvider.class, RadioThermostatStateDescriptionProvider.class })
@NonNullByDefault @NonNullByDefault
public class RadioThermostatStateDescriptionProvider extends BaseDynamicStateDescriptionProvider { public class RadioThermostatStateDescriptionProvider extends BaseDynamicStateDescriptionProvider {
@Reference
protected void setChannelTypeI18nLocalizationService( @Activate
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) { public RadioThermostatStateDescriptionProvider(final @Reference EventPublisher eventPublisher, //
final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, //
final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.eventPublisher = eventPublisher;
this.itemChannelLinkRegistry = itemChannelLinkRegistry;
this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService; this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService;
} }
protected void unsetChannelTypeI18nLocalizationService(
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.channelTypeI18nLocalizationService = null;
}
} }