mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-25 11:45:49 +01:00
Applied formatter in all files
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
parent
8d5d789371
commit
a18e60d7d7
@ -19,7 +19,6 @@ import static ${package}.internal.${bindingIdCamelCase}BindingConstants.*;
|
|||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
import ${package}.internal.${bindingIdCamelCase}Configuration;
|
|
||||||
import org.eclipse.smarthome.core.thing.ChannelUID;
|
import org.eclipse.smarthome.core.thing.ChannelUID;
|
||||||
import org.eclipse.smarthome.core.thing.Thing;
|
import org.eclipse.smarthome.core.thing.Thing;
|
||||||
import org.eclipse.smarthome.core.thing.ThingStatus;
|
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);
|
private final Logger logger = LoggerFactory.getLogger(${bindingIdCamelCase}Handler.class);
|
||||||
|
|
||||||
@Nullable
|
private @Nullable ${bindingIdCamelCase}Configuration config;
|
||||||
private ${bindingIdCamelCase}Configuration config;
|
|
||||||
|
|
||||||
public ${bindingIdCamelCase}Handler(Thing thing) {
|
public ${bindingIdCamelCase}Handler(Thing thing) {
|
||||||
super(thing);
|
super(thing);
|
||||||
@ -53,7 +51,7 @@ public class ${bindingIdCamelCase}Handler extends BaseThingHandler {
|
|||||||
if (command instanceof RefreshType) {
|
if (command instanceof RefreshType) {
|
||||||
// TODO: handle data refresh
|
// TODO: handle data refresh
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: handle command
|
// TODO: handle command
|
||||||
|
|
||||||
// Note: if communication with thing fails for some reason,
|
// Note: if communication with thing fails for some reason,
|
||||||
@ -69,8 +67,8 @@ public class ${bindingIdCamelCase}Handler extends BaseThingHandler {
|
|||||||
config = getConfigAs(${bindingIdCamelCase}Configuration.class);
|
config = getConfigAs(${bindingIdCamelCase}Configuration.class);
|
||||||
|
|
||||||
// TODO: Initialize the handler.
|
// TODO: Initialize the handler.
|
||||||
// The framework requires you to return from this method quickly. Also, before leaving this method a thing
|
// 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
|
// 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.
|
// 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
|
// 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
|
// 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.
|
// 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.
|
// we set this upfront to reliably check status updates in unit tests.
|
||||||
updateStatus(ThingStatus.UNKNOWN);
|
updateStatus(ThingStatus.UNKNOWN);
|
||||||
|
|
||||||
// Example for background initialization:
|
// Example for background initialization:
|
||||||
scheduler.execute(() -> {
|
scheduler.execute(() -> {
|
||||||
boolean thingReachable = true; // <background task with long running initialization here>
|
boolean thingReachable = true; // <background task with long running initialization here>
|
||||||
|
@ -22,7 +22,6 @@ import java.util.Set;
|
|||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
import ${package}.internal.${bindingIdCamelCase}Handler;
|
|
||||||
import org.eclipse.smarthome.core.thing.Thing;
|
import org.eclipse.smarthome.core.thing.Thing;
|
||||||
import org.eclipse.smarthome.core.thing.ThingTypeUID;
|
import org.eclipse.smarthome.core.thing.ThingTypeUID;
|
||||||
import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory;
|
import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory;
|
||||||
|
@ -8,6 +8,10 @@ binding.${bindingId}.description = <Your localized Binding description>
|
|||||||
thing-type.${bindingId}.sample.label = <Your localized Thing label>
|
thing-type.${bindingId}.sample.label = <Your localized Thing label>
|
||||||
thing-type.${bindingId}.sample.description = <Your localized Thing description>
|
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 types
|
||||||
channel-type.${bindingId}.sample-channel.label = <Your localized Channel label>
|
channel-type.${bindingId}.sample-channel.label = <Your localized Channel label>
|
||||||
channel-type.${bindingId}.sample-channel.description = <Your localized Channel description>
|
channel-type.${bindingId}.sample-channel.description = <Your localized Channel description>
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<thing:thing-descriptions bindingId="${bindingId}"
|
<thing:thing-descriptions bindingId="${bindingId}"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
|
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">
|
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
|
||||||
|
|
||||||
<!-- Sample Thing Type -->
|
<!-- Sample Thing Type -->
|
||||||
<thing-type id="sample">
|
<thing-type id="sample">
|
||||||
<label>${bindingIdCamelCase} Binding Thing</label>
|
<label>${bindingIdCamelCase} Binding Thing</label>
|
||||||
<description>Sample thing for ${bindingIdCamelCase} Binding</description>
|
<description>Sample thing for ${bindingIdCamelCase} Binding</description>
|
||||||
|
|
||||||
<channels>
|
<channels>
|
||||||
<channel id="channel1" typeId="sample-channel" />
|
<channel id="channel1" typeId="sample-channel" />
|
||||||
</channels>
|
</channels>
|
||||||
|
|
||||||
<config-description>
|
<config-description>
|
||||||
<parameter name="config1" type="text" required="true">
|
<parameter name="config1" type="text" required="true">
|
||||||
<label>Sample parameter</label>
|
<label>Sample Parameter</label>
|
||||||
<description>This is a sample text configuration parameter.</description>
|
<description>This is a sample text configuration parameter</description>
|
||||||
</parameter>
|
</parameter>
|
||||||
</config-description>
|
</config-description>
|
||||||
|
|
||||||
</thing-type>
|
</thing-type>
|
||||||
|
|
||||||
<!-- Sample Channel Type -->
|
<!-- Sample Channel Type -->
|
||||||
<channel-type id="sample-channel">
|
<channel-type id="sample-channel">
|
||||||
<item-type>${bindingId}Item</item-type>
|
<item-type>${bindingId}Item</item-type>
|
||||||
<label>${bindingIdCamelCase} Binding Channel</label>
|
<label>${bindingIdCamelCase} Binding Channel</label>
|
||||||
<description>Sample channel for ${bindingIdCamelCase} Binding</description>
|
<description>Sample channel for ${bindingIdCamelCase} Binding</description>
|
||||||
</channel-type>
|
</channel-type>
|
||||||
|
|
||||||
</thing:thing-descriptions>
|
</thing:thing-descriptions>
|
||||||
|
Loading…
Reference in New Issue
Block a user