Skip to content
Snippets Groups Projects
Commit dc97aff8 authored by dev-manuel's avatar dev-manuel
Browse files

Moved meta files and repaired dependencies

parent 3f4a6b07
No related branches found
No related tags found
1 merge request!1Resolve "Update imports (away from eclipse)"
Showing
with 62 additions and 472 deletions
<?xml version="1.0" encoding="UTF-8"?>
<binding:binding id="openlicht" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd">
<name>OpenLicht Binding</name>
<description>This is the binding for OpenLicht.</description>
<author>René Schöne</author>
</binding:binding>
<?xml version="1.0" encoding="UTF-8"?>
<config-description:config-descriptions
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:config-description="http://eclipse.org/smarthome/schemas/config-description/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/config-description/v1.0.0 http://eclipse.org/smarthome/schemas/config-description-1.0.0.xsd">
<config-description uri="thing-type:openlicht:mqttdevice">
<parameter name="brokerName" type="text" required="true">
<label>Broker Name</label>
<description>Name of the broker as defined in the name of the broker thing. See the MQTT Binding for more information on how to create a MQTT broker thing.</description>
<context>service</context>
<default>embedded-mqtt-broker</default>
</parameter>
<parameter name="base-topic" type="text" required="true">
<label>Base-Topic</label>
<description>Base topic for publishing updates. Do not include a trailing slash.</description>
<default>sensors</default>
</parameter>
<parameter name="byte-based-messages" type="boolean" required="false">
<label>Byte-based MQTT Messages</label>
<description>Interpret MQTT messages as raw bytes. If false, interpret the messages as Strings containing numbers.</description>
<default>false</default>
</parameter>
<parameter name="unsupported-category-reset" type="integer" required="false">
<label>MQTT Unsupported Category Reset Timeout</label>
<description>Timeout in seconds to log again unsupported MQTT categories. Set to zero to disable (default).</description>
<default>0</default>
</parameter>
</config-description>
</config-description:config-descriptions>
# binding
binding.openlicht.name = OpenLicht Binding
binding.openlicht.description = OpenLicht Binding
# thing types
thing-type.openlicht.skywriterhat.skywriter-hat.label = SkyWriterHAT
thing-type.openlicht.skywriterhat.skywriter-hat.description = SkyWriterHAT Gesture Recognition
# channel types
channel-type.openlicht.skywriterhat.flick-type.label = Last Flick
channel-type.openlicht.skywriterhat.flick-type.description = Last Flick detected (and its direction)
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="openlicht"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">
<!-- Eraser Thing Type -->
<thing-type id="eraser">
<label>Eraser</label>
<description>Establish communication with a running eraser via MQTT</description>
<config-description>
<parameter name="brokerName" type="text" required="true">
<label>Broker Name</label>
<description>Name of the broker as defined in the name of the broker thing. See the MQTT Binding for more information on how to create a MQTT broker thing.</description>
<context>service</context>
<default>embedded-mqtt-broker</default>
</parameter>
<parameter name="byte-based-messages" type="boolean" required="false">
<label>Byte-based MQTT Messages</label>
<description>Interpret MQTT messages as raw bytes. If false, interpret the messages as Strings containing numbers.</description>
<default>false</default>
</parameter>
<parameter name="base-topic" type="text" required="true">
<label>Base-Topic</label>
<description>Base topic for publishing updates. Do not include a trailing slash.</description>
<default>oh/in</default>
</parameter>
<parameter name="outTopic" type="text" required="true">
<label>Outgoing topic</label>
<description>MQTT topic prefix for messages leaving openHAB to eraser.</description>
<default>oh/out/</default>
</parameter>
<parameter name="publish-all" type="boolean" required="true">
<label>Publish All</label>
<description>If enabled, changes of every item will be published. Otherwise only those of the members of group set in the parameter "Publish Group"</description>
<default>true</default>
</parameter>
<parameter name="publish-group" type="text" required="false">
<label>Publish group</label>
<description>Group whose members will trigger an update</description>
<context>item</context>
</parameter>
</config-description>
</thing-type>
<!-- Skywriter HAT Thing Type -->
<thing-type id="skywriter-hat">
<label>SkyWriterHAT</label>
<description>SkyWriterHAT Gesture Recognition</description>
<channels>
<channel typeId="flick-type" id="flick" />
</channels>
<config-description-ref uri="thing-type:openlicht:mqttdevice" />
</thing-type>
<!-- Flick Type -->
<channel-type id="flick-type">
<item-type>String</item-type>
<label>Last Flick</label>
<description>Last Flick detected (and its direction)</description>
<category>Motion</category>
<state readOnly="true" />
</channel-type>
<!-- Polar M600 Thing Type -->
<thing-type id="polar-m600">
<label>Polar M600</label>
<description>Provides sensor information from a Polar M600 smart watch</description>
<channels>
<channel typeId="acceleration-type" id="acceleration-x">
<label>Acceleration X</label>
</channel>
<channel typeId="acceleration-type" id="acceleration-y">
<label>Acceleration Y</label>
</channel>
<channel typeId="acceleration-type" id="acceleration-z">
<label>Acceleration Z</label>
</channel>
<channel typeId="rotation-type" id="rotation-x">
<label>Rotation X</label>
</channel>
<channel typeId="rotation-type" id="rotation-y">
<label>Rotation Y</label>
</channel>
<channel typeId="rotation-type" id="rotation-z">
<label>Rotation Z</label>
</channel>
<channel typeId="activity-type" id="activity" />
<channel typeId="heart-rate-type" id="heart-rate" />
<channel typeId="steps-type" id="steps" />
<channel typeId="brightness-type" id="brightness" />
</channels>
<config-description-ref uri="thing-type:openlicht:mqttdevice" />
</thing-type>
<!-- Polar M600 Thing Type -->
<thing-type id="moto-360">
<label>Moto 360</label>
<description>Provides sensor information from a Moto 360 smart watch</description>
<channels>
<channel typeId="acceleration-type" id="acceleration-x">
<label>Acceleration X</label>
</channel>
<channel typeId="acceleration-type" id="acceleration-y">
<label>Acceleration Y</label>
</channel>
<channel typeId="acceleration-type" id="acceleration-z">
<label>Acceleration Z</label>
</channel>
<channel typeId="rotation-type" id="rotation-x">
<label>Rotation X</label>
</channel>
<channel typeId="rotation-type" id="rotation-y">
<label>Rotation Y</label>
</channel>
<channel typeId="rotation-type" id="rotation-z">
<label>Rotation Z</label>
</channel>
<channel typeId="activity-type" id="activity" />
<channel typeId="heart-rate-type" id="heart-rate" />
<channel typeId="steps-type" id="steps" />
<channel typeId="brightness-type" id="brightness" />
</channels>
<config-description-ref uri="thing-type:openlicht:mqttdevice" />
</thing-type>
<!-- Accelerator Type -->
<channel-type id="acceleration-type">
<item-type>Number</item-type>
<label>Acceleration</label>
<description>Acceleration in one direction in meters per second.</description>
<category>Motion</category>
<state readOnly="true" />
</channel-type>
<!-- Rotation Type -->
<channel-type id="rotation-type">
<item-type>Number</item-type>
<label>Rotation</label>
<description>Rotation around one axis (unitless).</description>
<category>Motion</category>
<state readOnly="true" />
</channel-type>
<!-- Activity Type -->
<channel-type id="activity-type">
<item-type>String</item-type>
<label>Activity</label>
<description>Current recognized activity.</description>
<state readOnly="true" />
<event>
<options>
<option value="Runnning">running</option>
<option value="Walking">walking</option>
<option value="Resting">resting</option>
<option value="Unknown">unknown</option>
</options>
</event>
</channel-type>
<!-- Heart Rate Type -->
<channel-type id="heart-rate-type">
<item-type>Number</item-type>
<label>Heart Rate</label>
<description>Heart rate in beats per minute.</description>
<state readOnly="true" />
</channel-type>
<!-- Steps Type -->
<channel-type id="steps-type">
<item-type>Number</item-type>
<label>Steps</label>
<description>Steps run today.</description>
<state readOnly="true" ></state>
</channel-type>
<!-- Samsung S6 Thing Type -->
<thing-type id="samsung-s6">
<label>Samsung S6</label>
<description>Provides sensor information from a smart phone (a Samsung S6 in our case)</description>
<channels>
<channel typeId="brightness-type" id="brightness" />
<channel typeId="acceleration-type" id="acceleration-x">
<label>Acceleration X</label>
</channel>
<channel typeId="acceleration-type" id="acceleration-y">
<label>Acceleration Y</label>
</channel>
<channel typeId="acceleration-type" id="acceleration-z">
<label>Acceleration Z</label>
</channel>
<channel typeId="rotation-type" id="rotation-x">
<label>Rotation X</label>
</channel>
<channel typeId="rotation-type" id="rotation-y">
<label>Rotation Y</label>
</channel>
<channel typeId="rotation-type" id="rotation-z">
<label>Rotation Z</label>
</channel>
</channels>
<config-description-ref uri="thing-type:openlicht:mqttdevice" />
</thing-type>
<!-- General Brightness Type -->
<channel-type id="brightness-type">
<item-type>Number</item-type>
<label>Brightness</label>
<description>Brightness (Lux).</description>
<category>Light</category>
<state readOnly="true" ></state>
</channel-type>
</thing:thing-descriptions>
Manifest-Version: 1.0
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-ManifestVersion: 2
Bundle-Name: OpenLicht Binding
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-SymbolicName: org.openhab.binding.openlicht;singleton:=true
Bundle-Vendor: openHAB
Bundle-Version: 2.3.0.qualifier
Import-Package:
org.eclipse.jdt.annotation;resolution:=optional,
org.eclipse.smarthome.binding.mqtt.handler,
org.eclipse.smarthome.config.core,
org.eclipse.smarthome.core.common.registry,
org.eclipse.smarthome.core.events,
org.eclipse.smarthome.core.items,
org.eclipse.smarthome.core.items.events,
org.eclipse.smarthome.core.library.types,
org.eclipse.smarthome.core.thing,
org.eclipse.smarthome.core.thing.binding,
org.eclipse.smarthome.core.thing.binding.builder,
org.eclipse.smarthome.core.thing.type,
org.eclipse.smarthome.core.types,
org.eclipse.smarthome.io.transport.mqtt,
org.osgi.framework,
org.osgi.service.component,
org.osgi.service.component.annotations;version="[1.3.0,2.0.0)";resolution:=optional,
org.slf4j
Service-Component: OSGI-INF/*.xml
Export-Package: org.openhab.binding.openlicht,
org.openhab.binding.openlicht.handler
Automatic-Module-Name: org.openhab.binding.openlicht
# OpenLicht Binding
Currently, the additional package `org.eclipse.smarthome.io.transport.mqtt` is needed for this binding to work.
It can be exported as a plugin from the OpenHAB Eclipse.
_Give some details about what this binding is meant for - a protocol, system, specific device._
This binding is used as a collection of bindings developed with the project [OpenLicht](http://openlicht.de).
All bindings use MQTT for communication between the device and openHAB.
_If possible, provide some resources like pictures, a YouTube video, etc. to give an impression of what can be done with this binding. You can place such resources into a `doc` folder next to this README.md._
## Supported Things
Name | Description | Handler | Sub topic
-----|-------------|---------|----------
SkyWriterHAT | [Product-Page](https://shop.pimoroni.com/products/skywriter-hat) - [Documentation](http://docs.pimoroni.com/skywriter/#) | [SkyWriterHATHandler](https://git-st.inf.tu-dresden.de/OpenLicht/org.openhab.binding.openlicht/blob/master/src/main/java/org/openhab/binding/openlicht/handler/SkyWriterHATHandler.java) | `skywriter`
Polar M600 | [Product-Page](https://www.polar.com/de/produkte/sport/M600-Fitness-Smartwatch) | [PolarM600Handler](https://git-st.inf.tu-dresden.de/OpenLicht/org.openhab.binding.openlicht/blob/master/src/main/java/org/openhab/binding/openlicht/handler/PolarM600Handler.java) | `polar`
Moto 360 | from CyPhyMan, [Product-Page](https://www.motorola.com.au/products/moto-360) | [Moto360Handler](https://git-st.inf.tu-dresden.de/OpenLicht/org.openhab.binding.openlicht/blob/master/src/main/java/org/openhab/binding/openlicht/handler/Moto360Handler.java) | `moto360`
Samsung S6 | Could actually be any smart phone | [SamsungS6Handler](https://git-st.inf.tu-dresden.de/OpenLicht/org.openhab.binding.openlicht/blob/master/src/main/java/org/openhab/binding/openlicht/handler/SamsungS6Handler.java) | `samsung`¹
¹:warning: The topic is currently set in `AbstractSmartphoneHandler`. This is a bug.
_Please describe the different supported things / devices within this section._
_Which different types are supported, which models were tested etc.?_
_Note that it is planned to generate some part of this based on the XML files within ```src/main/resources/OH-INF/thing``` of your binding._
## Discovery
Not implemented (yet).
_Describe the available auto-discovery features here. Mention for what it works and what needs to be kept in mind when using it._
## Binding Configuration
*None*
_If your binding requires or supports general configuration settings, please create a folder ```cfg``` and place the configuration file ```<bindingId>.cfg``` inside it. In this section, you should link to this file and provide some information about the options. The file could e.g. look like:_
## Thing Configuration
```
# Configuration for the Philips Hue Binding
#
# Default secret key for the pairing of the Philips Hue Bridge.
# It has to be between 10-40 (alphanumeric) characters
# This may be changed by the user for security reasons.
secret=openHABSecret
```
All bindings share the same configuration, with the following options (copied from `ESH-INF/config/config.xml`:
_Note that it is planned to generate some part of this based on the information that is available within ```src/main/resources/OH-INF/binding``` of your binding._
Name | Label | Description | Default
-----|-------|-------------|--------
`brokerName` | Broker Name | Name of the broker as defined in the &lt;broker&gt;.url in services/mqtt.cfg. See the MQTT Binding for more information on how to configure MQTT broker connections. | `mosquitto`²
`base-topic` | Base-Topic | Base topic for publishing updates. Do not include a trailing slash. | `sensors`
`unsupported-category-reset` | MQTT Unsupported Category Reset Timeout (optional) | Timeout in seconds to log again unsupported MQTT categories. Set to zero to disable (default). | `0`
_If your binding does not offer any generic configurations, you can remove this section completely._
²:warning: This must match the configured MQTT broker within openHAB, see `services/mqtt.cfg`.
## Thing Configuration
## Channel Types
_Describe what is needed to manually configure a thing, either through the (Paper) UI or via a thing-file. This should be mainly about its mandatory and optional configuration parameters. A short example entry for a thing file can help!_
Type-Name | Kind | Label | Description | Category
----------|------|-------|-------------|---------
`flick-type` | Text | Last Flick | Last Flick detected (and its direction) | Motion
`brightness-type` | Number | Brightness | Brightness (Lux) | Light
`acceleration-type` | Number | Acceleration | Acceleration in one direction in meters per second. | Motion
`rotation-type` | Number | Rotation | Rotation around one axis (unitless). | Motion
`activity-type` | String | Activity | Current recognized activity, one of Runnning, Walking, Resting, Unknown. | -
`heart-rate-type` | Number | Heart Rate | Heart rate in beats per minute. | -
`steps-type` | Number | Steps | Steps run today. | -
_Note that it is planned to generate some part of this based on the XML files within ```src/main/resources/OH-INF/thing``` of your binding._
## Channels
Supported by Binding | Type-Name | Id | Label
---------------------|-----------|----|------
SkyWriterHAT | `flick-type` | `flick` | -
Polar M600, Moto 360, Samsung S6 | `brightness-type` | `brightness` | -
Polar M600, Moto 360 | `acceleration-type` | `acceleration-x` | Acceleration X
Polar M600, Moto 360 | `acceleration-type` | `acceleration-y` | Acceleration Y
Polar M600, Moto 360 | `acceleration-type` | `acceleration-z` | Acceleration Z
Polar M600, Moto 360, Samsung S6 | `rotation-type` | `rotation-x` | Rotation X
Polar M600, Moto 360, Samsung S6 | `rotation-type` | `rotation-y` | Rotation Y
Polar M600, Moto 360, Samsung S6 | `rotation-type` | `rotation-z` | Rotation Z
Polar M600, Moto 360 | `activity-type` | `activity` | -
Polar M600, Moto 360 | `heart-rate-type` | `heart-rate` | -
Polar M600, Moto 360 | `steps-type` | `steps` | -
## Data flow
[AndroidSensorSharing repository](https://git-st.inf.tu-dresden.de/OpenLicht/AndroidSensorSharing)
![material/dataflow.png](material/dataflow.png)
_Here you should provide information about available channel types, what their meaning is and how they can be used._
_Note that it is planned to generate some part of this based on the XML files within ```src/main/resources/OH-INF/thing``` of your binding._
| channel | type | description |
|----------|--------|------------------------------|
| control | Switch | This is the control channel |
## Full Example
_Provide a full usage example based on textual configuration files (*.things, *.items, *.sitemap)._
## Any custom content here!
_Feel free to add additional sections for whatever you think should also be mentioned about your binding!_
......@@ -3,6 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<dependencies>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
......@@ -10,13 +11,6 @@
<version>3.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.openhab.core.bundles</groupId>
<artifactId>org.openhab.core.automation</artifactId>
<version>3.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<parent>
......
......@@ -5,10 +5,6 @@
<feature>wrap</feature>
<bundle>mvn:org.openhab.addons.bundles/org.openhab.binding.mqtt/3.0.0-SNAPSHOT</bundle>
<bundle>mvn:org.openhab.addons.bundles/org.openhab.binding.openlicht/3.0.0-SNAPSHOT</bundle>
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.automation/3.0.0-SNAPSHOT</bundle>
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.config.core/3.0.0-SNAPSHOT</bundle>
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.ephemeris/3.0.0-SNAPSHOT</bundle>
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.thing/3.0.0-SNAPSHOT</bundle>
<bundle>wrap:mvn:org.lastnpe.eea/eea-all/2.2.1</bundle>
</feature>
</features>
/**
* Copyright (c) 2014,2018 by the respective copyright holders.
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.openlicht;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.thing.ThingTypeUID;
/**
* The {@link BindingConstants} class defines common constants, which are
* used across the whole binding.
*
* @author René Schöne - Initial contribution
*/
@NonNullByDefault
public class BindingConstants {
private static final String BINDING_ID = "openlicht";
// Configuration keys
public static final String CONFIG_BROKER_NAME = "brokerName";
public static final String CONFIG_BASE_TOPIC = "base-topic";
public static final String CONFIG_BYTE_BASED_MESSAGES = "byte-based-messages";
public static final String CONFIG_TIMEOUT_MQTT_UNSUPPORTED_CATEGORIES = "unsupported-category-reset";
public static final String CONFIG_ERASER_OUT_TOPIC = "outTopic";
public static final String CONFIG_ERASER_PUBLISH_GROUP = "publish-group";
public static final String CONFIG_ERASER_PUBLISH_ALL = "publish-all";
// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_SKYWRITER_HAT = new ThingTypeUID(BINDING_ID, "skywriter-hat");
public static final ThingTypeUID THING_TYPE_POLAR_M600 = new ThingTypeUID(BINDING_ID, "polar-m600");
public static final ThingTypeUID THING_TYPE_MOTO_360 = new ThingTypeUID(BINDING_ID, "moto-360");
public static final ThingTypeUID THING_TYPE_SAMSUNG_S6 = new ThingTypeUID(BINDING_ID, "samsung-s6");
public static final ThingTypeUID THING_TYPE_ERASER = new ThingTypeUID(BINDING_ID, "eraser");
// List of all Channel ids
public static final String CHANNEL_FLICK = "flick";
public static final String CHANNEL_ACCELERATION_X = "acceleration-x";
public static final String CHANNEL_ACCELERATION_Y = "acceleration-y";
public static final String CHANNEL_ACCELERATION_Z = "acceleration-z";
public static final String CHANNEL_ROTATION_X = "rotation-x";
public static final String CHANNEL_ROTATION_Y = "rotation-y";
public static final String CHANNEL_ROTATION_Z = "rotation-z";
public static final String CHANNEL_ACTIVITY = "activity";
public static final String CHANNEL_HEART_RATE = "heart-rate";
public static final String CHANNEL_STEPS = "steps";
public static final String CHANNEL_BRIGHTNESS = "brightness";
// List of MQTT categories
public static final String MQTT_CATEGORY_FLICK = "flick";
public static final String MQTT_CATEGORY_ACCELERATION = "acceleration";
public static final String MQTT_CATEGORY_ROTATION = "rotation";
public static final String MQTT_CATEGORY_ACTIVITY = "activity";
public static final String MQTT_CATEGORY_HEART_RATE = "heart-rate";
public static final String MQTT_CATEGORY_STEPS = "steps";
public static final String MQTT_CATEGORY_BRIGHTNESS = "brightness";
public static final String MQTT_BROKER_URL = "tcp://localhost:1883";
}
package org.openhab.binding.openlicht.handler;
import static org.openhab.binding.openlicht.BindingConstants.*;
import static org.openhab.binding.openlicht.handler.HandlerPhase.*;
import static org.openhab.binding.openlicht.internal.OpenLichtBindingConstants.*;
import java.math.BigDecimal;
import java.util.concurrent.ScheduledExecutorService;
......@@ -11,17 +11,17 @@ import java.util.concurrent.locks.ReentrantLock;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.mqtt.handler.AbstractBrokerHandler;
import org.openhab.core.thing.ThingRegistryChangeListener;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.openhab.core.io.transport.mqtt.MqttBrokerConnection;
import org.openhab.core.io.transport.mqtt.MqttMessageSubscriber;
import org.openhab.core.io.transport.mqtt.MqttServiceObserver;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingRegistry;
import org.openhab.core.thing.ThingRegistryChangeListener;
import org.openhab.core.thing.ThingStatus;
import org.openhab.core.thing.ThingStatusDetail;
import org.openhab.core.thing.binding.BaseThingHandler;
import org.openhab.core.thing.binding.ThingHandler;
import org.openhab.core.io.transport.mqtt.MqttBrokerConnection;
import org.openhab.core.io.transport.mqtt.MqttMessageSubscriber;
import org.openhab.core.io.transport.mqtt.MqttServiceObserver;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.osgi.framework.Version;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -344,5 +344,4 @@ public abstract class AbstractMqttHandler extends BaseThingHandler
// output[i] = input.getFloat();
// }
// }
}
......@@ -12,7 +12,7 @@
*/
package org.openhab.binding.openlicht.handler;
import static org.openhab.binding.openlicht.BindingConstants.*;
import static org.openhab.binding.openlicht.internal.OpenLichtBindingConstants.*;
import java.nio.ByteBuffer;
import java.nio.DoubleBuffer;
......@@ -20,12 +20,12 @@ import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.Thing;
import org.openhab.core.types.Command;
import org.openhab.core.types.RefreshType;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -128,5 +128,4 @@ public abstract class AbstractSmartWatchHandler extends AbstractMqttHandler {
protected boolean subscribeSubTopics() {
return true;
}
}
......@@ -12,19 +12,19 @@
*/
package org.openhab.binding.openlicht.handler;
import static org.openhab.binding.openlicht.BindingConstants.*;
import static org.openhab.binding.openlicht.internal.OpenLichtBindingConstants.*;
import java.nio.ByteBuffer;
import java.nio.DoubleBuffer;
import java.util.HashSet;
import java.util.Set;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.Thing;
import org.openhab.core.types.Command;
import org.openhab.core.types.RefreshType;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -105,5 +105,4 @@ public abstract class AbstractSmartphoneHandler extends AbstractMqttHandler {
protected String getSubTopic() {
return "phone";
}
}
......@@ -7,6 +7,9 @@ import java.util.Set;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.openhab.binding.openlicht.internal.DelegateEraserRegistryChangeListener;
import org.openhab.binding.openlicht.internal.OpenLichtBindingConstants;
import org.openhab.core.events.EventPublisher;
import org.openhab.core.items.GenericItem;
import org.openhab.core.items.GroupItem;
......@@ -25,9 +28,6 @@ import org.openhab.core.thing.Thing;
import org.openhab.core.types.Command;
import org.openhab.core.types.State;
import org.openhab.core.types.TypeParser;
import org.openhab.binding.openlicht.BindingConstants;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.openhab.binding.openlicht.internal.DelegateEraserRegistryChangeListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -62,9 +62,9 @@ public class EraserHandler extends AbstractMqttHandler implements StateChangeLis
@Override
protected void moreInitializeBefore() {
this.outTopic = getConfigValueAsString(BindingConstants.CONFIG_ERASER_OUT_TOPIC);
this.publishGroupName = getConfigValueAsString(BindingConstants.CONFIG_ERASER_PUBLISH_GROUP);
this.publishAll = getConfigValueAsBoolean(BindingConstants.CONFIG_ERASER_PUBLISH_ALL);
this.outTopic = getConfigValueAsString(OpenLichtBindingConstants.CONFIG_ERASER_OUT_TOPIC);
this.publishGroupName = getConfigValueAsString(OpenLichtBindingConstants.CONFIG_ERASER_PUBLISH_GROUP);
this.publishAll = getConfigValueAsBoolean(OpenLichtBindingConstants.CONFIG_ERASER_PUBLISH_ALL);
if (this.outTopic.charAt(this.outTopic.length() - 1) != '/') {
this.outTopic += "/";
}
......@@ -275,5 +275,4 @@ public class EraserHandler extends AbstractMqttHandler implements StateChangeLis
public void stateUpdated(Item item, State state) {
// ignored, as no change
}
}
package org.openhab.binding.openlicht.handler;
import org.openhab.core.thing.Thing;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.openhab.core.thing.Thing;
public class Moto360Handler extends AbstractSmartWatchHandler {
......@@ -13,5 +13,4 @@ public class Moto360Handler extends AbstractSmartWatchHandler {
protected String getSubTopic() {
return "moto360";
}
}
package org.openhab.binding.openlicht.handler;
import static org.openhab.binding.openlicht.BindingConstants.*;
import static org.openhab.binding.openlicht.internal.OpenLichtBindingConstants.*;
import java.util.HashMap;
import java.util.Map;
......@@ -68,5 +68,4 @@ public class MqttUtils {
updateState.accept(channelId, entry.getValue());
}
}
}
package org.openhab.binding.openlicht.handler;
import org.openhab.core.thing.Thing;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.openhab.core.thing.Thing;
public class PolarM600Handler extends AbstractSmartWatchHandler {
......@@ -13,5 +13,4 @@ public class PolarM600Handler extends AbstractSmartWatchHandler {
protected String getSubTopic() {
return "polar";
}
}
package org.openhab.binding.openlicht.handler;
import org.openhab.core.thing.Thing;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.openhab.core.thing.Thing;
public class SamsungS6Handler extends AbstractSmartphoneHandler {
public SamsungS6Handler(Thing thing, ConfigurationHolder configurationHolder) {
super(thing, configurationHolder);
}
}
......@@ -8,14 +8,14 @@
*/
package org.openhab.binding.openlicht.handler;
import static org.openhab.binding.openlicht.BindingConstants.CHANNEL_FLICK;
import static org.openhab.binding.openlicht.internal.OpenLichtBindingConstants.CHANNEL_FLICK;
import org.eclipse.jdt.annotation.NonNull;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.openhab.core.library.types.StringType;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.Thing;
import org.openhab.core.types.Command;
import org.openhab.binding.openlicht.internal.ConfigurationHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -53,5 +53,4 @@ public class SkyWriterHATHandler extends AbstractMqttHandler {
protected String getSubTopic() {
return "skywriter";
}
}
......@@ -4,9 +4,9 @@ import java.util.concurrent.ScheduledExecutorService;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.core.events.EventPublisher;
import org.openhab.core.io.transport.mqtt.MqttService;
import org.openhab.core.items.ItemRegistry;
import org.openhab.core.thing.ThingRegistry;
import org.openhab.core.io.transport.mqtt.MqttService;
import org.osgi.framework.Version;
public interface ConfigurationHolder {
......@@ -27,5 +27,4 @@ public interface ConfigurationHolder {
EventPublisher getEventPublisher();
Version getVersion();
}
package org.openhab.binding.openlicht.internal;
import java.util.Collection;
import org.openhab.core.items.ItemRegistryChangeListener;
import org.openhab.core.items.Item;
import org.openhab.binding.openlicht.handler.EraserHandler;
import org.openhab.core.items.Item;
import org.openhab.core.items.ItemRegistryChangeListener;
public class DelegateEraserRegistryChangeListener implements ItemRegistryChangeListener {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment