]> git.basschouten.com Git - openhab-addons.git/blob
15955446e0b149e42dbc17f511eabf0b0a889aa1
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.hyperion.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider;
17 import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService;
18 import org.openhab.core.thing.type.DynamicStateDescriptionProvider;
19 import org.osgi.service.component.annotations.Component;
20 import org.osgi.service.component.annotations.Reference;
21
22 /**
23  * The {@link HyperionStateDescriptionProvider} class is a dynamic provider of state options while leaving other state
24  * description fields as original.
25  *
26  * @author Gregory Moyer - Initial contribution
27  * @author Daniel Walters - Adapted for Hyperion Binding
28  */
29 @Component(service = { DynamicStateDescriptionProvider.class, HyperionStateDescriptionProvider.class })
30 @NonNullByDefault
31 public class HyperionStateDescriptionProvider extends BaseDynamicStateDescriptionProvider {
32
33     @Reference
34     protected void setChannelTypeI18nLocalizationService(
35             final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
36         this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService;
37     }
38
39     protected void unsetChannelTypeI18nLocalizationService(
40             final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
41         this.channelTypeI18nLocalizationService = null;
42     }
43 }