import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
}
}
- /**
- * Choose a tag for a channel
- */
- Set<String> checkTags(String unitOfMeasure, @Nullable Boolean readOnly) {
- Set<String> tags = new HashSet<>();
- if (unitOfMeasure.indexOf("°C") == 0 || unitOfMeasure.indexOf("K") == 0) {
- if (null != readOnly) {
- if (readOnly) {
- tags.add("CurrentTemperature");
- } else {
- tags.add("TargetTemperature");
- }
- }
- }
- return tags;
- }
-
/**
* Choose a category for a channel
*/
channelType = ChannelTypeBuilder.state(channelTypeUID, label, itemType) //
.withDescription(description) //
.withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())) //
- .withTags(checkTags(unitOfMeasure, state.isReadOnly())) //
.withStateDescriptionFragment(state) //
.withConfigDescriptionURI(configDescriptionUriChannel).build();
} catch (URISyntaxException ex) {
CONFIG_DESCRIPTION_URI_CHANNEL);
channelType = ChannelTypeBuilder.state(channelTypeUID, label, itemType) //
.withDescription(description) //
- .withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())) //
- .withTags(checkTags(unitOfMeasure, state.isReadOnly())).build();
+ .withCategory(checkCategory(unitOfMeasure, category, state.isReadOnly())).build();
}
channelTypeProvider.addChannelType(channelType);