public final ThingTypeUID thingTypeUID;
public final FeatureArea feature;
public final String apiName;
- public final int thingTypeVersion;
+ public final String thingTypeVersion;
ModuleType(FeatureArea feature, String apiName, int thingTypeVersion, @Nullable ModuleType bridge,
Set<Class<? extends Capability>> capabilities, ChannelGroup... channelGroups) {
this.apiName = apiName;
this.channelGroups = Set.of(channelGroups);
this.thingTypeUID = new ThingTypeUID(BINDING_ID, name().toLowerCase().replace("_", "-"));
- this.thingTypeVersion = thingTypeVersion;
+ this.thingTypeVersion = Integer.toString(thingTypeVersion);
}
public boolean isLogical() {
properties = new HashMap<>(thing.getProperties());
firstLaunch = properties.isEmpty();
if (firstLaunch) {
- properties.put(PROPERTY_THING_TYPE_VERSION, Integer.toString(moduleType.thingTypeVersion));
+ properties.put(PROPERTY_THING_TYPE_VERSION, moduleType.thingTypeVersion);
if (!moduleType.isLogical()) {
String name = moduleType.apiName.isBlank() ? moduleType.name() : moduleType.apiName;
properties.put(PROPERTY_MODEL_ID, name);
import java.util.Collection;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.Optional;
import org.eclipse.jdt.annotation.NonNullByDefault;
.withRepresentationProperty(NAThingConfiguration.ID)
.withExtensibleChannelTypeIds(moduleType.getExtensions())
.withChannelGroupDefinitions(getGroupDefinitions(moduleType))
+ .withProperties(Map.of(PROPERTY_THING_TYPE_VERSION, moduleType.thingTypeVersion))
.withConfigDescriptionURI(moduleType.getConfigDescription());
ThingTypeUID bridgeType = moduleType.getBridge().thingTypeUID;