From 3f4a6b0773f9e313ba71ca2a527c30e149eb7116 Mon Sep 17 00:00:00 2001
From: dev-manuel <manuel_krofficial@online.de>
Date: Mon, 30 Nov 2020 05:59:04 +0100
Subject: [PATCH] Updated code but other files persist

---
 NOTICE                                        |  13 +++
 pom.xml                                       |  27 +++--
 src/main/feature/feature.xml                  |  23 ++++
 src/main/history/dependencies.xml             |  14 +++
 .../binding/openlicht/BindingConstants.java   |   2 +-
 .../handler/AbstractMqttHandler.java          |  34 +++---
 .../handler/AbstractSmartWatchHandler.java    |  10 +-
 .../handler/AbstractSmartphoneHandler.java    |  12 +--
 .../openlicht/handler/EraserHandler.java      |  38 +++----
 .../openlicht/handler/Moto360Handler.java     |   2 +-
 .../binding/openlicht/handler/MqttUtils.java  |   4 +-
 .../openlicht/handler/PolarM600Handler.java   |   4 +-
 .../openlicht/handler/SamsungS6Handler.java   |   2 +-
 .../handler/SkyWriterHATHandler.java          |  11 +-
 .../openlicht/handler/UpdateState.java        |   2 +-
 .../internal/ConfigurationHolder.java         |  10 +-
 .../DelegateEraserRegistryChangeListener.java |  11 +-
 .../internal/OpenLichtBindingConstants.java   |  34 ++++++
 .../internal/OpenLichtConfiguration.java      |   7 +-
 .../openlicht/internal/OpenLichtHandler.java  | 100 ++++++++++++++++++
 .../internal/OpenLichtHandlerFactory.java     |  23 ++--
 src/main/resources/OH-INF/binding/binding.xml |   9 ++
 .../OH-INF/i18n/openlicht_xx_XX.properties    |  17 +++
 .../resources/OH-INF/thing/thing-types.xml    |  32 ++++++
 24 files changed, 354 insertions(+), 87 deletions(-)
 create mode 100644 NOTICE
 create mode 100644 src/main/feature/feature.xml
 create mode 100644 src/main/history/dependencies.xml
 create mode 100644 src/main/java/org/openhab/binding/openlicht/internal/OpenLichtBindingConstants.java
 create mode 100644 src/main/java/org/openhab/binding/openlicht/internal/OpenLichtHandler.java
 create mode 100644 src/main/resources/OH-INF/binding/binding.xml
 create mode 100644 src/main/resources/OH-INF/i18n/openlicht_xx_XX.properties
 create mode 100644 src/main/resources/OH-INF/thing/thing-types.xml

diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..38d625e
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,13 @@
+This content is produced and maintained by the openHAB project.
+
+* Project home: https://www.openhab.org
+
+== Declared Project Licenses
+
+This program and the accompanying materials are made available under the terms
+of the Eclipse Public License 2.0 which is available at
+https://www.eclipse.org/legal/epl-2.0/.
+
+== Source Code
+
+https://github.com/openhab/openhab-addons
diff --git a/pom.xml b/pom.xml
index 65813eb..2cc0e6e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,17 +1,32 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
+  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>
+      <artifactId>org.openhab.binding.mqtt</artifactId>
+      <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>
-    <artifactId>pom</artifactId>
-    <groupId>org.openhab.binding</groupId>
-    <version>2.3.0-SNAPSHOT</version>
+    <groupId>org.openhab.addons.bundles</groupId>
+    <artifactId>org.openhab.addons.reactor.bundles</artifactId>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.openhab.binding.openlicht</artifactId>
-  <packaging>eclipse-plugin</packaging>
 
-  <name>OpenLicht Binding</name>
+  <name>openHAB Add-ons :: Bundles :: OpenLicht Binding</name>
 
 </project>
diff --git a/src/main/feature/feature.xml b/src/main/feature/feature.xml
new file mode 100644
index 0000000..e086eca
--- /dev/null
+++ b/src/main/feature/feature.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+	Copyright (c) 2010-2020 Contributors to the openHAB project
+
+	See the NOTICE file(s) distributed with this work for additional
+	information.
+
+	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
+
+-->
+<features name="org.openhab.binding.openlicht-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
+	<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>
+
+	<feature name="openhab-binding-openlicht" description="OpenLicht Binding" version="${project.version}">
+		<feature>openhab-runtime-base</feature>
+		<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.openlicht/${project.version}</bundle>
+	</feature>
+</features>
diff --git a/src/main/history/dependencies.xml b/src/main/history/dependencies.xml
new file mode 100644
index 0000000..2e16a5a
--- /dev/null
+++ b/src/main/history/dependencies.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="org.openhab.binding.openlicht-3.0.0-SNAPSHOT">
+    <feature version="0.0.0">
+        <feature>openhab-runtime-base</feature>
+        <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>
diff --git a/src/main/java/org/openhab/binding/openlicht/BindingConstants.java b/src/main/java/org/openhab/binding/openlicht/BindingConstants.java
index 6e66ee7..ecec987 100644
--- a/src/main/java/org/openhab/binding/openlicht/BindingConstants.java
+++ b/src/main/java/org/openhab/binding/openlicht/BindingConstants.java
@@ -13,7 +13,7 @@
 package org.openhab.binding.openlicht;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.eclipse.smarthome.core.thing.ThingTypeUID;
+import org.openhab.core.thing.ThingTypeUID;
 
 /**
  * The {@link BindingConstants} class defines common constants, which are
diff --git a/src/main/java/org/openhab/binding/openlicht/handler/AbstractMqttHandler.java b/src/main/java/org/openhab/binding/openlicht/handler/AbstractMqttHandler.java
index 7fcd087..0d43245 100644
--- a/src/main/java/org/openhab/binding/openlicht/handler/AbstractMqttHandler.java
+++ b/src/main/java/org/openhab/binding/openlicht/handler/AbstractMqttHandler.java
@@ -10,24 +10,24 @@ import java.util.concurrent.locks.ReentrantLock;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.smarthome.binding.mqtt.handler.AbstractBrokerHandler;
-import org.eclipse.smarthome.core.common.registry.RegistryChangeListener;
-import org.eclipse.smarthome.core.thing.Thing;
-import org.eclipse.smarthome.core.thing.ThingRegistry;
-import org.eclipse.smarthome.core.thing.ThingStatus;
-import org.eclipse.smarthome.core.thing.ThingStatusDetail;
-import org.eclipse.smarthome.core.thing.binding.BaseThingHandler;
-import org.eclipse.smarthome.core.thing.binding.ThingHandler;
-import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection;
-import org.eclipse.smarthome.io.transport.mqtt.MqttMessageSubscriber;
-import org.eclipse.smarthome.io.transport.mqtt.MqttServiceObserver;
+import org.openhab.binding.mqtt.handler.AbstractBrokerHandler;
+import org.openhab.core.thing.ThingRegistryChangeListener;
+import org.openhab.core.thing.Thing;
+import org.openhab.core.thing.ThingRegistry;
+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;
 
 public abstract class AbstractMqttHandler extends BaseThingHandler
-        implements MqttMessageSubscriber, MqttServiceObserver, RegistryChangeListener<Thing> {
+        implements MqttMessageSubscriber, MqttServiceObserver, ThingRegistryChangeListener {
 
     private final @NonNull Logger logger = LoggerFactory.getLogger(AbstractMqttHandler.class);
     private @Nullable ThingRegistry thingRegistry;
@@ -240,7 +240,9 @@ public abstract class AbstractMqttHandler extends BaseThingHandler
         // String topic = subscribeSubTopics() ? (getTopic().substring(0, usedTopicLength) + "out")
         // : (getTopic() + "/out");
         byte[] payload = message.getBytes();
-        currentBrokerConnection.publish(topic, payload);
+
+        // Last two parameters of the following line are experimental
+        currentBrokerConnection.publish(topic, payload, 1, true);
     }
 
     public final String getTopic() {
@@ -259,8 +261,8 @@ public abstract class AbstractMqttHandler extends BaseThingHandler
     /**
      * Updates the state of the managed thing. Subclasses may override this to add special handling.
      *
-     * @param phase       Phase of the thing configuration
-     * @param success     Whether the phase was successful
+     * @param phase Phase of the thing configuration
+     * @param success Whether the phase was successful
      * @param description Detailed description of the status
      */
     protected void statusUpdate(HandlerPhase phase, boolean success, String description) {
@@ -342,5 +344,5 @@ public abstract class AbstractMqttHandler extends BaseThingHandler
     // output[i] = input.getFloat();
     // }
     // }
-
+    
 }
diff --git a/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartWatchHandler.java b/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartWatchHandler.java
index 5e7c953..dabf329 100644
--- a/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartWatchHandler.java
+++ b/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartWatchHandler.java
@@ -20,11 +20,11 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
-import org.eclipse.smarthome.core.library.types.DecimalType;
-import org.eclipse.smarthome.core.thing.ChannelUID;
-import org.eclipse.smarthome.core.thing.Thing;
-import org.eclipse.smarthome.core.types.Command;
-import org.eclipse.smarthome.core.types.RefreshType;
+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;
diff --git a/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartphoneHandler.java b/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartphoneHandler.java
index 6ba499c..fee1fa3 100644
--- a/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartphoneHandler.java
+++ b/src/main/java/org/openhab/binding/openlicht/handler/AbstractSmartphoneHandler.java
@@ -19,11 +19,11 @@ import java.nio.DoubleBuffer;
 import java.util.HashSet;
 import java.util.Set;
 
-import org.eclipse.smarthome.core.library.types.DecimalType;
-import org.eclipse.smarthome.core.thing.ChannelUID;
-import org.eclipse.smarthome.core.thing.Thing;
-import org.eclipse.smarthome.core.types.Command;
-import org.eclipse.smarthome.core.types.RefreshType;
+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,5 @@ public abstract class AbstractSmartphoneHandler extends AbstractMqttHandler {
     protected String getSubTopic() {
         return "phone";
     }
-
+    
 }
diff --git a/src/main/java/org/openhab/binding/openlicht/handler/EraserHandler.java b/src/main/java/org/openhab/binding/openlicht/handler/EraserHandler.java
index 0842930..100d356 100644
--- a/src/main/java/org/openhab/binding/openlicht/handler/EraserHandler.java
+++ b/src/main/java/org/openhab/binding/openlicht/handler/EraserHandler.java
@@ -7,24 +7,24 @@ import java.util.Set;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.smarthome.core.events.EventPublisher;
-import org.eclipse.smarthome.core.items.GenericItem;
-import org.eclipse.smarthome.core.items.GroupItem;
-import org.eclipse.smarthome.core.items.Item;
-import org.eclipse.smarthome.core.items.ItemNotFoundException;
-import org.eclipse.smarthome.core.items.ItemRegistry;
-import org.eclipse.smarthome.core.items.StateChangeListener;
-import org.eclipse.smarthome.core.items.events.ItemEventFactory;
-import org.eclipse.smarthome.core.library.types.DateTimeType;
-import org.eclipse.smarthome.core.library.types.DecimalType;
-import org.eclipse.smarthome.core.library.types.HSBType;
-import org.eclipse.smarthome.core.library.types.OnOffType;
-import org.eclipse.smarthome.core.library.types.StringType;
-import org.eclipse.smarthome.core.thing.ChannelUID;
-import org.eclipse.smarthome.core.thing.Thing;
-import org.eclipse.smarthome.core.types.Command;
-import org.eclipse.smarthome.core.types.State;
-import org.eclipse.smarthome.core.types.TypeParser;
+import org.openhab.core.events.EventPublisher;
+import org.openhab.core.items.GenericItem;
+import org.openhab.core.items.GroupItem;
+import org.openhab.core.items.Item;
+import org.openhab.core.items.ItemNotFoundException;
+import org.openhab.core.items.ItemRegistry;
+import org.openhab.core.items.StateChangeListener;
+import org.openhab.core.items.events.ItemEventFactory;
+import org.openhab.core.library.types.DateTimeType;
+import org.openhab.core.library.types.DecimalType;
+import org.openhab.core.library.types.HSBType;
+import org.openhab.core.library.types.OnOffType;
+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.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;
@@ -275,5 +275,5 @@ public class EraserHandler extends AbstractMqttHandler implements StateChangeLis
     public void stateUpdated(Item item, State state) {
         // ignored, as no change
     }
-
+    
 }
diff --git a/src/main/java/org/openhab/binding/openlicht/handler/Moto360Handler.java b/src/main/java/org/openhab/binding/openlicht/handler/Moto360Handler.java
index bf201fa..8f40481 100644
--- a/src/main/java/org/openhab/binding/openlicht/handler/Moto360Handler.java
+++ b/src/main/java/org/openhab/binding/openlicht/handler/Moto360Handler.java
@@ -1,6 +1,6 @@
 package org.openhab.binding.openlicht.handler;
 
-import org.eclipse.smarthome.core.thing.Thing;
+import org.openhab.core.thing.Thing;
 import org.openhab.binding.openlicht.internal.ConfigurationHolder;
 
 public class Moto360Handler extends AbstractSmartWatchHandler {
diff --git a/src/main/java/org/openhab/binding/openlicht/handler/MqttUtils.java b/src/main/java/org/openhab/binding/openlicht/handler/MqttUtils.java
index dc0dbfa..52075c3 100644
--- a/src/main/java/org/openhab/binding/openlicht/handler/MqttUtils.java
+++ b/src/main/java/org/openhab/binding/openlicht/handler/MqttUtils.java
@@ -6,7 +6,7 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.eclipse.smarthome.core.library.types.DecimalType;
+import org.openhab.core.library.types.DecimalType;
 
 public class MqttUtils {
 
@@ -68,5 +68,5 @@ public class MqttUtils {
             updateState.accept(channelId, entry.getValue());
         }
     }
-
+    
 }
diff --git a/src/main/java/org/openhab/binding/openlicht/handler/PolarM600Handler.java b/src/main/java/org/openhab/binding/openlicht/handler/PolarM600Handler.java
index 6e30e8d..3e68610 100644
--- a/src/main/java/org/openhab/binding/openlicht/handler/PolarM600Handler.java
+++ b/src/main/java/org/openhab/binding/openlicht/handler/PolarM600Handler.java
@@ -1,6 +1,6 @@
 package org.openhab.binding.openlicht.handler;
 
-import org.eclipse.smarthome.core.thing.Thing;
+import org.openhab.core.thing.Thing;
 import org.openhab.binding.openlicht.internal.ConfigurationHolder;
 
 public class PolarM600Handler extends AbstractSmartWatchHandler {
@@ -13,5 +13,5 @@ public class PolarM600Handler extends AbstractSmartWatchHandler {
     protected String getSubTopic() {
         return "polar";
     }
-
+    
 }
diff --git a/src/main/java/org/openhab/binding/openlicht/handler/SamsungS6Handler.java b/src/main/java/org/openhab/binding/openlicht/handler/SamsungS6Handler.java
index 2a65819..dfb6de5 100644
--- a/src/main/java/org/openhab/binding/openlicht/handler/SamsungS6Handler.java
+++ b/src/main/java/org/openhab/binding/openlicht/handler/SamsungS6Handler.java
@@ -1,6 +1,6 @@
 package org.openhab.binding.openlicht.handler;
 
-import org.eclipse.smarthome.core.thing.Thing;
+import org.openhab.core.thing.Thing;
 import org.openhab.binding.openlicht.internal.ConfigurationHolder;
 
 public class SamsungS6Handler extends AbstractSmartphoneHandler {
diff --git a/src/main/java/org/openhab/binding/openlicht/handler/SkyWriterHATHandler.java b/src/main/java/org/openhab/binding/openlicht/handler/SkyWriterHATHandler.java
index d936713..41c3cdf 100644
--- a/src/main/java/org/openhab/binding/openlicht/handler/SkyWriterHATHandler.java
+++ b/src/main/java/org/openhab/binding/openlicht/handler/SkyWriterHATHandler.java
@@ -11,10 +11,10 @@ package org.openhab.binding.openlicht.handler;
 import static org.openhab.binding.openlicht.BindingConstants.CHANNEL_FLICK;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.smarthome.core.library.types.StringType;
-import org.eclipse.smarthome.core.thing.ChannelUID;
-import org.eclipse.smarthome.core.thing.Thing;
-import org.eclipse.smarthome.core.types.Command;
+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;
@@ -24,6 +24,7 @@ import org.slf4j.LoggerFactory;
  * sent to the channel "$BASE_TOPIC/skywriter".
  *
  * @author René Schöne - Initial contribution
+ * @author Manuel Krombholz - Upgrade OH Version
  */
 public class SkyWriterHATHandler extends AbstractMqttHandler {
 
@@ -52,5 +53,5 @@ public class SkyWriterHATHandler extends AbstractMqttHandler {
     protected String getSubTopic() {
         return "skywriter";
     }
-
+    
 }
diff --git a/src/main/java/org/openhab/binding/openlicht/handler/UpdateState.java b/src/main/java/org/openhab/binding/openlicht/handler/UpdateState.java
index c03e3cc..3c1728b 100644
--- a/src/main/java/org/openhab/binding/openlicht/handler/UpdateState.java
+++ b/src/main/java/org/openhab/binding/openlicht/handler/UpdateState.java
@@ -2,7 +2,7 @@ package org.openhab.binding.openlicht.handler;
 
 import java.util.function.BiConsumer;
 
-import org.eclipse.smarthome.core.types.State;
+import org.openhab.core.types.State;
 
 @FunctionalInterface
 public interface UpdateState extends BiConsumer<String, State> {
diff --git a/src/main/java/org/openhab/binding/openlicht/internal/ConfigurationHolder.java b/src/main/java/org/openhab/binding/openlicht/internal/ConfigurationHolder.java
index 0ae8f02..3ba6de1 100644
--- a/src/main/java/org/openhab/binding/openlicht/internal/ConfigurationHolder.java
+++ b/src/main/java/org/openhab/binding/openlicht/internal/ConfigurationHolder.java
@@ -3,10 +3,10 @@ package org.openhab.binding.openlicht.internal;
 import java.util.concurrent.ScheduledExecutorService;
 
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.smarthome.core.events.EventPublisher;
-import org.eclipse.smarthome.core.items.ItemRegistry;
-import org.eclipse.smarthome.core.thing.ThingRegistry;
-import org.eclipse.smarthome.io.transport.mqtt.MqttService;
+import org.openhab.core.events.EventPublisher;
+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,5 @@ public interface ConfigurationHolder {
     EventPublisher getEventPublisher();
 
     Version getVersion();
-
+    
 }
diff --git a/src/main/java/org/openhab/binding/openlicht/internal/DelegateEraserRegistryChangeListener.java b/src/main/java/org/openhab/binding/openlicht/internal/DelegateEraserRegistryChangeListener.java
index 9d0ea78..a1ecfad 100644
--- a/src/main/java/org/openhab/binding/openlicht/internal/DelegateEraserRegistryChangeListener.java
+++ b/src/main/java/org/openhab/binding/openlicht/internal/DelegateEraserRegistryChangeListener.java
@@ -1,10 +1,11 @@
 package org.openhab.binding.openlicht.internal;
 
-import org.eclipse.smarthome.core.common.registry.RegistryChangeListener;
-import org.eclipse.smarthome.core.items.Item;
+import java.util.Collection;
+import org.openhab.core.items.ItemRegistryChangeListener;
+import org.openhab.core.items.Item;
 import org.openhab.binding.openlicht.handler.EraserHandler;
 
-public class DelegateEraserRegistryChangeListener implements RegistryChangeListener<Item> {
+public class DelegateEraserRegistryChangeListener implements ItemRegistryChangeListener {
 
     private EraserHandler handler;
 
@@ -27,4 +28,8 @@ public class DelegateEraserRegistryChangeListener implements RegistryChangeListe
         handler.updated(oldElement, element);
     }
 
+    @Override
+    public void allItemsChanged(Collection<String> oldItemNames) {
+        // TODO: Implement!
+    }
 }
diff --git a/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtBindingConstants.java b/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtBindingConstants.java
new file mode 100644
index 0000000..f816535
--- /dev/null
+++ b/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtBindingConstants.java
@@ -0,0 +1,34 @@
+/**
+ * Copyright (c) 2010-2020 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * 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.internal;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.openhab.core.thing.ThingTypeUID;
+
+/**
+ * The {@link OpenLichtBindingConstants} class defines common constants, which are
+ * used across the whole binding.
+ *
+ * @author Manuel Krombholz - Initial contribution
+ */
+@NonNullByDefault
+public class OpenLichtBindingConstants {
+
+    private static final String BINDING_ID = "openlicht";
+
+    // List of all Thing Type UIDs
+    public static final ThingTypeUID THING_TYPE_SAMPLE = new ThingTypeUID(BINDING_ID, "sample");
+
+    // List of all Channel ids
+    public static final String CHANNEL_1 = "channel1";
+}
diff --git a/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtConfiguration.java b/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtConfiguration.java
index ab149a8..b60c72a 100644
--- a/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtConfiguration.java
+++ b/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtConfiguration.java
@@ -1,8 +1,8 @@
 /**
- * Copyright (c) 2014,2018 by the respective copyright holders.
+ * Copyright (c) 2010-2020 Contributors to the openHAB project
  *
  * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
+ * information.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License 2.0 which is available at
@@ -15,7 +15,8 @@ package org.openhab.binding.openlicht.internal;
 /**
  * The {@link OpenLichtConfiguration} class contains fields mapping thing configuration parameters.
  *
- * @author René Schöne - Initial contribution
+  * @author René Schöne - Initial contribution
+ * @author Manuel Krombholz - Upgrade OH Version
  */
 public class OpenLichtConfiguration {
 
diff --git a/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtHandler.java b/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtHandler.java
new file mode 100644
index 0000000..2a33fe9
--- /dev/null
+++ b/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtHandler.java
@@ -0,0 +1,100 @@
+/**
+ * Copyright (c) 2010-2020 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * 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.internal;
+
+import static org.openhab.binding.openlicht.internal.OpenLichtBindingConstants.*;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+import org.openhab.core.thing.ChannelUID;
+import org.openhab.core.thing.Thing;
+import org.openhab.core.thing.ThingStatus;
+import org.openhab.core.thing.binding.BaseThingHandler;
+import org.openhab.core.types.Command;
+import org.openhab.core.types.RefreshType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The {@link OpenLichtHandler} is responsible for handling commands, which are
+ * sent to one of the channels.
+ *
+ * @author Manuel Krombholz - Initial contribution
+ */
+@NonNullByDefault
+public class OpenLichtHandler extends BaseThingHandler {
+
+    private final Logger logger = LoggerFactory.getLogger(OpenLichtHandler.class);
+
+    private @Nullable OpenLichtConfiguration config;
+
+    public OpenLichtHandler(Thing thing) {
+        super(thing);
+    }
+
+    @Override
+    public void handleCommand(ChannelUID channelUID, Command command) {
+        if (CHANNEL_1.equals(channelUID.getId())) {
+            if (command instanceof RefreshType) {
+                // TODO: handle data refresh
+            }
+
+            // TODO: handle command
+
+            // Note: if communication with thing fails for some reason,
+            // indicate that by setting the status with detail information:
+            // updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
+            // "Could not control device at IP address x.x.x.x");
+        }
+    }
+
+    @Override
+    public void initialize() {
+        config = getConfigAs(OpenLichtConfiguration.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
+        // 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
+        // background.
+
+        // set the thing status to UNKNOWN temporarily and let the background task decide for the real status.
+        // 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>
+            // when done do:
+            if (thingReachable) {
+                updateStatus(ThingStatus.ONLINE);
+            } else {
+                updateStatus(ThingStatus.OFFLINE);
+            }
+        });
+
+        // These logging types should be primarily used by bindings
+        // logger.trace("Example trace message");
+        // logger.debug("Example debug message");
+        // logger.warn("Example warn message");
+
+        // Note: When initialization can NOT be done set the status with more details for further
+        // analysis. See also class ThingStatusDetail for all available status details.
+        // Add a description to give user information to understand why thing does not work as expected. E.g.
+        // updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
+        // "Can not access device as username and/or password are invalid");
+    }
+}
diff --git a/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtHandlerFactory.java b/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtHandlerFactory.java
index ced6638..6f80894 100644
--- a/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtHandlerFactory.java
+++ b/src/main/java/org/openhab/binding/openlicht/internal/OpenLichtHandlerFactory.java
@@ -1,8 +1,8 @@
 /**
- * Copyright (c) 2014,2018 by the respective copyright holders.
+ * Copyright (c) 2010-2020 Contributors to the openHAB project
  *
  * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
+ * information.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License 2.0 which is available at
@@ -23,15 +23,15 @@ import java.util.stream.Stream;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.smarthome.core.events.EventPublisher;
-import org.eclipse.smarthome.core.items.ItemRegistry;
-import org.eclipse.smarthome.core.thing.Thing;
-import org.eclipse.smarthome.core.thing.ThingRegistry;
-import org.eclipse.smarthome.core.thing.ThingTypeUID;
-import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory;
-import org.eclipse.smarthome.core.thing.binding.ThingHandler;
-import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory;
-import org.eclipse.smarthome.io.transport.mqtt.MqttService;
+import org.openhab.core.events.EventPublisher;
+import org.openhab.core.items.ItemRegistry;
+import org.openhab.core.thing.Thing;
+import org.openhab.core.thing.ThingRegistry;
+import org.openhab.core.thing.ThingTypeUID;
+import org.openhab.core.thing.binding.BaseThingHandlerFactory;
+import org.openhab.core.thing.binding.ThingHandler;
+import org.openhab.core.thing.binding.ThingHandlerFactory;
+import org.openhab.core.io.transport.mqtt.MqttService;
 import org.openhab.binding.openlicht.handler.EraserHandler;
 import org.openhab.binding.openlicht.handler.Moto360Handler;
 import org.openhab.binding.openlicht.handler.PolarM600Handler;
@@ -52,6 +52,7 @@ import org.slf4j.LoggerFactory;
  * handlers.
  *
  * @author René Schöne - Initial contribution
+ * @author Manuel Krombholz - Upgrade OH Version
  */
 @NonNullByDefault
 @Component(configurationPid = "binding.openlicht", service = ThingHandlerFactory.class)
diff --git a/src/main/resources/OH-INF/binding/binding.xml b/src/main/resources/OH-INF/binding/binding.xml
new file mode 100644
index 0000000..c261ba9
--- /dev/null
+++ b/src/main/resources/OH-INF/binding/binding.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<binding:binding id="openlicht" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:binding="https://openhab.org/schemas/binding/v1.0.0"
+	xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd">
+
+	<name>OpenLicht Binding</name>
+	<description>This is the binding for OpenLicht.</description>
+
+</binding:binding>
diff --git a/src/main/resources/OH-INF/i18n/openlicht_xx_XX.properties b/src/main/resources/OH-INF/i18n/openlicht_xx_XX.properties
new file mode 100644
index 0000000..fbd6a84
--- /dev/null
+++ b/src/main/resources/OH-INF/i18n/openlicht_xx_XX.properties
@@ -0,0 +1,17 @@
+# FIXME: please substitute the xx_XX with a proper locale, ie. de_DE
+# FIXME: please do not add the file to the repo if you add or change no content
+# binding
+binding.openlicht.name = <Your localized Binding name>
+binding.openlicht.description = <Your localized Binding description>
+
+# thing types
+thing-type.openlicht.sample.label = <Your localized Thing label>
+thing-type.openlicht.sample.description = <Your localized Thing description>
+
+# thing type config description
+thing-type.config.openlicht.sample.config1.label = <Your localized config parameter label>
+thing-type.config.openlicht.sample.config1.description = <Your localized config parameter description>
+
+# channel types
+channel-type.openlicht.sample-channel.label = <Your localized Channel label>
+channel-type.openlicht.sample-channel.description = <Your localized Channel description>
diff --git a/src/main/resources/OH-INF/thing/thing-types.xml b/src/main/resources/OH-INF/thing/thing-types.xml
new file mode 100644
index 0000000..c193a13
--- /dev/null
+++ b/src/main/resources/OH-INF/thing/thing-types.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<thing:thing-descriptions bindingId="openlicht"
+	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>OpenLicht Binding Thing</label>
+		<description>Sample thing for OpenLicht Binding</description>
+
+		<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>
+
+	</thing-type>
+
+	<!-- Sample Channel Type -->
+	<channel-type id="sample-channel">
+		<item-type>openlichtItem</item-type>
+		<label>OpenLicht Binding Channel</label>
+		<description>Sample channel for OpenLicht Binding</description>
+	</channel-type>
+
+</thing:thing-descriptions>
-- 
GitLab