2 * Copyright (c) 2010-2024 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.sensibo.internal;
15 import java.util.Collection;
16 import java.util.Collections;
17 import java.util.Locale;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.eclipse.jdt.annotation.Nullable;
21 import org.openhab.binding.sensibo.internal.handler.SensiboSkyHandler;
22 import org.openhab.core.thing.binding.ThingHandler;
23 import org.openhab.core.thing.binding.ThingHandlerService;
24 import org.openhab.core.thing.type.ChannelGroupType;
25 import org.openhab.core.thing.type.ChannelGroupTypeProvider;
26 import org.openhab.core.thing.type.ChannelGroupTypeUID;
27 import org.openhab.core.thing.type.ChannelType;
28 import org.openhab.core.thing.type.ChannelTypeProvider;
29 import org.openhab.core.thing.type.ChannelTypeUID;
30 import org.osgi.service.component.annotations.Component;
31 import org.osgi.service.component.annotations.ServiceScope;
34 * Channel Type Provider that does a callback the SensiboSkyHandler that initiated it.
36 * @author Arne Seime - Initial contribution
38 @Component(scope = ServiceScope.PROTOTYPE, service = { CallbackChannelsTypeProvider.class, ChannelTypeProvider.class,
39 ChannelGroupTypeProvider.class })
41 public class CallbackChannelsTypeProvider
42 implements ChannelTypeProvider, ChannelGroupTypeProvider, ThingHandlerService {
43 private @NonNullByDefault({}) SensiboSkyHandler handler;
46 public Collection<ChannelType> getChannelTypes(@Nullable final Locale locale) {
47 return handler.getChannelTypes(locale);
51 public @Nullable ChannelType getChannelType(final ChannelTypeUID channelTypeUID, @Nullable final Locale locale) {
52 return handler.getChannelType(channelTypeUID, locale);
56 public @Nullable ChannelGroupType getChannelGroupType(final ChannelGroupTypeUID channelGroupTypeUID,
57 @Nullable final Locale locale) {
62 public Collection<ChannelGroupType> getChannelGroupTypes(@Nullable final Locale locale) {
63 return Collections.emptyList();
68 public ThingHandler getThingHandler() {
74 public void setThingHandler(final ThingHandler handler) {
75 this.handler = (SensiboSkyHandler) handler;