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;
32 * Channel Type Provider that does a callback the SensiboSkyHandler that initiated it.
34 * @author Arne Seime - Initial contribution
37 public class CallbackChannelsTypeProvider
38 implements ChannelTypeProvider, ChannelGroupTypeProvider, ThingHandlerService {
39 private @NonNullByDefault({}) SensiboSkyHandler handler;
42 public Collection<ChannelType> getChannelTypes(@Nullable final Locale locale) {
43 return handler.getChannelTypes(locale);
47 public @Nullable ChannelType getChannelType(final ChannelTypeUID channelTypeUID, @Nullable final Locale locale) {
48 return handler.getChannelType(channelTypeUID, locale);
52 public @Nullable ChannelGroupType getChannelGroupType(final ChannelGroupTypeUID channelGroupTypeUID,
53 @Nullable final Locale locale) {
58 public Collection<ChannelGroupType> getChannelGroupTypes(@Nullable final Locale locale) {
59 return Collections.emptyList();
64 public ThingHandler getThingHandler() {
70 public void setThingHandler(final ThingHandler handler) {
71 this.handler = (SensiboSkyHandler) handler;