Applied formatter in all files

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
Christoph Weitkamp 2019-05-01 12:38:12 +02:00 committed by Markus Rathgeb
parent 8d5d789371
commit a18e60d7d7
4 changed files with 32 additions and 31 deletions

View File

@ -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; // <background task with long running initialization here>

View File

@ -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;

View File

@ -8,6 +8,10 @@ binding.${bindingId}.description = <Your localized Binding description>
thing-type.${bindingId}.sample.label = <Your localized Thing label>
thing-type.${bindingId}.sample.description = <Your localized Thing description>
# thing type config description
thing-type.config.${bindingId}.sample.config1.label = <Your localized config parameter label>
thing-type.config.${bindingId}.sample.config1.description = <Your localized config parameter description>
# channel types
channel-type.${bindingId}.sample-channel.label = <Your localized Channel label>
channel-type.${bindingId}.sample-channel.description = <Your localized Channel description>

View File

@ -1,32 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="${bindingId}"
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">
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 Type -->
<thing-type id="sample">
<label>${bindingIdCamelCase} Binding Thing</label>
<description>Sample thing for ${bindingIdCamelCase} Binding</description>
<!-- Sample Thing Type -->
<thing-type id="sample">
<label>${bindingIdCamelCase} Binding Thing</label>
<description>Sample thing for ${bindingIdCamelCase} Binding</description>
<channels>
<channel id="channel1" typeId="sample-channel" />
</channels>
<channels>
<channel id="channel1" typeId="sample-channel" />
</channels>
<config-description>
<parameter name="config1" type="text" required="true">
<label>Sample parameter</label>
<description>This is a sample text configuration parameter.</description>
</parameter>
</config-description>
<config-description>
<parameter name="config1" type="text" required="true">
<label>Sample Parameter</label>
<description>This is a sample text configuration parameter</description>
</parameter>
</config-description>
</thing-type>
</thing-type>
<!-- Sample Channel Type -->
<channel-type id="sample-channel">
<item-type>${bindingId}Item</item-type>
<label>${bindingIdCamelCase} Binding Channel</label>
<description>Sample channel for ${bindingIdCamelCase} Binding</description>
</channel-type>
<!-- Sample Channel Type -->
<channel-type id="sample-channel">
<item-type>${bindingId}Item</item-type>
<label>${bindingIdCamelCase} Binding Channel</label>
<description>Sample channel for ${bindingIdCamelCase} Binding</description>
</channel-type>
</thing:thing-descriptions>