mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
TuyaDynamicCommandDescriptionProvider needs to be a Component
Signed-off-by: Cody Cutrer <cody@cutrer.us>
This commit is contained in:
parent
f9b0b34389
commit
31ef89e39b
@ -13,7 +13,14 @@
|
||||
package org.openhab.binding.tuya.internal;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.openhab.core.events.EventPublisher;
|
||||
import org.openhab.core.thing.binding.BaseDynamicCommandDescriptionProvider;
|
||||
import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService;
|
||||
import org.openhab.core.thing.link.ItemChannelLinkRegistry;
|
||||
import org.openhab.core.thing.type.DynamicCommandDescriptionProvider;
|
||||
import org.osgi.service.component.annotations.Activate;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
|
||||
/**
|
||||
* This class provides the list of valid commands for dynamic channels.
|
||||
@ -22,5 +29,14 @@ import org.openhab.core.thing.binding.BaseDynamicCommandDescriptionProvider;
|
||||
*
|
||||
*/
|
||||
@NonNullByDefault
|
||||
@Component(service = { DynamicCommandDescriptionProvider.class, TuyaDynamicCommandDescriptionProvider.class })
|
||||
class TuyaDynamicCommandDescriptionProvider extends BaseDynamicCommandDescriptionProvider {
|
||||
@Activate
|
||||
public TuyaDynamicCommandDescriptionProvider(final @Reference EventPublisher eventPublisher, //
|
||||
final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, //
|
||||
final @Reference ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
|
||||
this.eventPublisher = eventPublisher;
|
||||
this.itemChannelLinkRegistry = itemChannelLinkRegistry;
|
||||
this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService;
|
||||
}
|
||||
}
|
||||
|
@ -69,9 +69,10 @@ public class TuyaHandlerFactory extends BaseThingHandlerFactory {
|
||||
|
||||
@Activate
|
||||
public TuyaHandlerFactory(@Reference HttpClientFactory httpClientFactory,
|
||||
@Reference TuyaDynamicCommandDescriptionProvider dynamicCommandDescriptionProvider,
|
||||
@Reference StorageService storageService) {
|
||||
this.httpClient = httpClientFactory.getCommonHttpClient();
|
||||
this.dynamicCommandDescriptionProvider = new TuyaDynamicCommandDescriptionProvider();
|
||||
this.dynamicCommandDescriptionProvider = dynamicCommandDescriptionProvider;
|
||||
this.eventLoopGroup = new NioEventLoopGroup();
|
||||
this.udpDiscoveryListener = new UdpDiscoveryListener(eventLoopGroup);
|
||||
this.storage = storageService.getStorage("org.openhab.binding.tuya.Schema");
|
||||
|
Loading…
Reference in New Issue
Block a user