2 * Copyright (c) 2010-2023 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.deconz.internal;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.thing.ThingUID;
17 import org.openhab.core.thing.binding.BaseDynamicCommandDescriptionProvider;
18 import org.openhab.core.thing.type.DynamicCommandDescriptionProvider;
19 import org.osgi.service.component.annotations.Component;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
24 * Dynamic channel command description provider.
25 * Overrides the command description for the controls, which receive its configuration in the runtime.
27 * @author Jan N. Klug - Initial contribution
30 @Component(service = { DynamicCommandDescriptionProvider.class, DeconzDynamicCommandDescriptionProvider.class })
31 public class DeconzDynamicCommandDescriptionProvider extends BaseDynamicCommandDescriptionProvider {
32 private final Logger logger = LoggerFactory.getLogger(DeconzDynamicCommandDescriptionProvider.class);
35 * remove all descriptions for a given thing
37 * @param thingUID the thing's UID
39 public void removeDescriptionsForThing(ThingUID thingUID) {
40 logger.trace("removing state description for thing {}", thingUID);
41 channelOptionsMap.entrySet().removeIf(entry -> entry.getKey().getThingUID().equals(thingUID));