diff --git a/tools/archetype/binding/src/main/resources/archetype-resources/src/main/java/internal/__bindingIdCamelCase__Handler.java b/tools/archetype/binding/src/main/resources/archetype-resources/src/main/java/internal/__bindingIdCamelCase__Handler.java index 9db6e9a36..c4b532092 100644 --- a/tools/archetype/binding/src/main/resources/archetype-resources/src/main/java/internal/__bindingIdCamelCase__Handler.java +++ b/tools/archetype/binding/src/main/resources/archetype-resources/src/main/java/internal/__bindingIdCamelCase__Handler.java @@ -19,7 +19,6 @@ import static ${package}.internal.${bindingIdCamelCase}BindingConstants.*; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import ${package}.internal.${bindingIdCamelCase}Configuration; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingStatus; @@ -40,8 +39,7 @@ public class ${bindingIdCamelCase}Handler extends BaseThingHandler { private final Logger logger = LoggerFactory.getLogger(${bindingIdCamelCase}Handler.class); - @Nullable - private ${bindingIdCamelCase}Configuration config; + private @Nullable ${bindingIdCamelCase}Configuration config; public ${bindingIdCamelCase}Handler(Thing thing) { super(thing); @@ -53,7 +51,7 @@ public class ${bindingIdCamelCase}Handler extends BaseThingHandler { if (command instanceof RefreshType) { // TODO: handle data refresh } - + // TODO: handle command // Note: if communication with thing fails for some reason, @@ -69,8 +67,8 @@ public class ${bindingIdCamelCase}Handler extends BaseThingHandler { config = getConfigAs(${bindingIdCamelCase}Configuration.class); // TODO: Initialize the handler. - // The framework requires you to return from this method quickly. Also, before leaving this method a thing - // status from one of ONLINE, OFFLINE or UNKNOWN must be set. This might already be the real thing status in + // The framework requires you to return from this method quickly. Also, before leaving this method a thing + // status from one of ONLINE, OFFLINE or UNKNOWN must be set. This might already be the real thing status in // case you can decide it directly. // In case you can not decide the thing status directly (e.g. for long running connection handshake using WAN // access or similar) you should set status UNKNOWN here and then decide the real status asynchronously in the @@ -80,7 +78,7 @@ public class ${bindingIdCamelCase}Handler extends BaseThingHandler { // the framework is then able to reuse the resources from the thing handler initialization. // we set this upfront to reliably check status updates in unit tests. updateStatus(ThingStatus.UNKNOWN); - + // Example for background initialization: scheduler.execute(() -> { boolean thingReachable = true; // diff --git a/tools/archetype/binding/src/main/resources/archetype-resources/src/main/java/internal/__bindingIdCamelCase__HandlerFactory.java b/tools/archetype/binding/src/main/resources/archetype-resources/src/main/java/internal/__bindingIdCamelCase__HandlerFactory.java index a26208d93..6c81b7fba 100644 --- a/tools/archetype/binding/src/main/resources/archetype-resources/src/main/java/internal/__bindingIdCamelCase__HandlerFactory.java +++ b/tools/archetype/binding/src/main/resources/archetype-resources/src/main/java/internal/__bindingIdCamelCase__HandlerFactory.java @@ -22,7 +22,6 @@ import java.util.Set; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import ${package}.internal.${bindingIdCamelCase}Handler; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; diff --git a/tools/archetype/binding/src/main/resources/archetype-resources/src/main/resources/ESH-INF/i18n/__bindingId___xx_XX.properties b/tools/archetype/binding/src/main/resources/archetype-resources/src/main/resources/ESH-INF/i18n/__bindingId___xx_XX.properties index 8c52d22a2..0ff4a8d68 100644 --- a/tools/archetype/binding/src/main/resources/archetype-resources/src/main/resources/ESH-INF/i18n/__bindingId___xx_XX.properties +++ b/tools/archetype/binding/src/main/resources/archetype-resources/src/main/resources/ESH-INF/i18n/__bindingId___xx_XX.properties @@ -8,6 +8,10 @@ binding.${bindingId}.description = thing-type.${bindingId}.sample.label = thing-type.${bindingId}.sample.description = +# thing type config description +thing-type.config.${bindingId}.sample.config1.label = +thing-type.config.${bindingId}.sample.config1.description = + # channel types channel-type.${bindingId}.sample-channel.label = channel-type.${bindingId}.sample-channel.description = diff --git a/tools/archetype/binding/src/main/resources/archetype-resources/src/main/resources/ESH-INF/thing/thing-types.xml b/tools/archetype/binding/src/main/resources/archetype-resources/src/main/resources/ESH-INF/thing/thing-types.xml index 9c590f48c..835b49b68 100644 --- a/tools/archetype/binding/src/main/resources/archetype-resources/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/tools/archetype/binding/src/main/resources/archetype-resources/src/main/resources/ESH-INF/thing/thing-types.xml @@ -1,32 +1,32 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - - - - Sample thing for ${bindingIdCamelCase} Binding + + + + Sample thing for ${bindingIdCamelCase} Binding - - - + + + - - - - This is a sample text configuration parameter. - - + + + + This is a sample text configuration parameter + + - + - - - ${bindingId}Item - - Sample channel for ${bindingIdCamelCase} Binding - + + + ${bindingId}Item + + Sample channel for ${bindingIdCamelCase} Binding +