Skip to content

Commit

Permalink
[innogysmarthome] migrate binding to bnd (openhab#5494)
Browse files Browse the repository at this point in the history
* migrate binding
* remove embedded libraries

Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Maximilian Hess <[email protected]>
  • Loading branch information
J-N-K authored and ne0h committed Sep 15, 2019
1 parent c9796c9 commit c99e344
Show file tree
Hide file tree
Showing 92 changed files with 113 additions and 127 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/addons/binding/org.openhab.binding.exec/ @kgoderis
/addons/binding/org.openhab.binding.feed/ @svilenvul
/addons/binding/org.openhab.binding.feed.test/ @svilenvul
/addons/binding/org.openhab.binding.innogysmarthome/ @ollie-dev
/addons/binding/org.openhab.binding.loxone/ @ppieczul
/addons/binding/org.openhab.binding.netatmo/ @clinique @cweitkamp @lolodomo
/addons/binding/org.openhab.binding.nikohomecontrol/ @mherwege
Expand Down Expand Up @@ -84,6 +83,7 @@
/bundles/org.openhab.binding.hyperion/ @tavalin
/bundles/org.openhab.binding.icloud/ @pgfeller
/bundles/org.openhab.binding.ihc/ @paulianttila
/bundles/org.openhab.binding.innogysmarthome/ @ollie-dev
/bundles/org.openhab.binding.ipp/ @peuter
/bundles/org.openhab.binding.irtrans/ @kgoderis
/bundles/org.openhab.binding.jeelink/ @vbier
Expand Down
13 changes: 0 additions & 13 deletions addons/binding/org.openhab.binding.innogysmarthome/.classpath

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 0 additions & 16 deletions addons/binding/org.openhab.binding.innogysmarthome/pom.xml

This file was deleted.

2 changes: 0 additions & 2 deletions addons/binding/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
<module>org.openhab.binding.exec</module>
<module>org.openhab.binding.feed</module>
<module>org.openhab.binding.feed.test</module>
<module>org.openhab.binding.innogysmarthome</module>
<module>org.openhab.binding.kvv</module>
<module>org.openhab.binding.loxone</module>
<module>org.openhab.binding.nikohomecontrol</module>
<module>org.openhab.binding.onkyo</module>
Expand Down
2 changes: 1 addition & 1 deletion bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.binding</groupId>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.innogysmarthome</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down
32 changes: 32 additions & 0 deletions bundles/org.openhab.binding.innogysmarthome/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,13 @@
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
37 changes: 37 additions & 0 deletions bundles/org.openhab.binding.innogysmarthome/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.innogysmarthome</artifactId>

<name>openHAB Add-ons :: Bundles :: innogy Smarthome Binding</name>

<dependencies>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-jackson2</artifactId>
<version>1.27.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
<version>1.27.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client</artifactId>
<version>1.27.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
*/
package org.openhab.binding.innogysmarthome.internal;

import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.smarthome.core.thing.ThingTypeUID;

import com.google.common.collect.ImmutableSet;

/**
* The {@link InnogyBindingConstants} class defines common constants, which are
* used across the whole binding.
Expand Down Expand Up @@ -101,10 +102,13 @@ public class InnogyBindingConstants {
public static final String DEVICE_SMART_METER = "SmartMeter";
public static final String DEVICE_TWO_WAY_METER = "TwoWayMeter";

public static final Set<String> SUPPORTED_DEVICES = ImmutableSet.of(DEVICE_SHC, DEVICE_PSS, DEVICE_PSSO,
DEVICE_VARIABLE_ACTUATOR, DEVICE_RST, DEVICE_RST2, DEVICE_WRT, DEVICE_WDS, DEVICE_ISS2, DEVICE_WSD,
DEVICE_WSD2, DEVICE_WMD, DEVICE_WMDO, DEVICE_WSC2, DEVICE_BRC8, DEVICE_ISC2, DEVICE_ISD2, DEVICE_ISR2,
DEVICE_PSD, DEVICE_ANALOG_METER, DEVICE_GENERATION_METER, DEVICE_SMART_METER, DEVICE_TWO_WAY_METER);
public static final Set<String> SUPPORTED_DEVICES = Collections
.unmodifiableSet(Stream
.of(DEVICE_SHC, DEVICE_PSS, DEVICE_PSSO, DEVICE_VARIABLE_ACTUATOR, DEVICE_RST, DEVICE_RST2,
DEVICE_WRT, DEVICE_WDS, DEVICE_ISS2, DEVICE_WSD, DEVICE_WSD2, DEVICE_WMD, DEVICE_WMDO,
DEVICE_WSC2, DEVICE_BRC8, DEVICE_ISC2, DEVICE_ISD2, DEVICE_ISR2, DEVICE_PSD,
DEVICE_ANALOG_METER, DEVICE_GENERATION_METER, DEVICE_SMART_METER, DEVICE_TWO_WAY_METER)
.collect(Collectors.toSet()));

// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge");
Expand Down Expand Up @@ -133,11 +137,14 @@ public class InnogyBindingConstants {
public static final ThingTypeUID THING_TYPE_SMART_METER = new ThingTypeUID(BINDING_ID, DEVICE_SMART_METER);
public static final ThingTypeUID THING_TYPE_TWO_WAY_METER = new ThingTypeUID(BINDING_ID, DEVICE_TWO_WAY_METER);

public static final Set<ThingTypeUID> SUPPORTED_DEVICE_THING_TYPES = ImmutableSet.of(THING_TYPE_PSS,
THING_TYPE_PSSO, THING_TYPE_VARIABLE_ACTUATOR, THING_TYPE_RST, THING_TYPE_RST2, THING_TYPE_WRT,
THING_TYPE_WDS, THING_TYPE_ISS2, THING_TYPE_WSD, THING_TYPE_WSD2, THING_TYPE_WMD, THING_TYPE_WMDO,
THING_TYPE_WSC2, THING_TYPE_BRC8, THING_TYPE_ISC2, THING_TYPE_ISD2, THING_TYPE_ISR2, THING_TYPE_PSD,
THING_TYPE_ANALOG_METER, THING_TYPE_GENERATION_METER, THING_TYPE_SMART_METER, THING_TYPE_TWO_WAY_METER);
public static final Set<ThingTypeUID> SUPPORTED_DEVICE_THING_TYPES = Collections
.unmodifiableSet(Stream
.of(THING_TYPE_PSS, THING_TYPE_PSSO, THING_TYPE_VARIABLE_ACTUATOR, THING_TYPE_RST, THING_TYPE_RST2,
THING_TYPE_WRT, THING_TYPE_WDS, THING_TYPE_ISS2, THING_TYPE_WSD, THING_TYPE_WSD2,
THING_TYPE_WMD, THING_TYPE_WMDO, THING_TYPE_WSC2, THING_TYPE_BRC8, THING_TYPE_ISC2,
THING_TYPE_ISD2, THING_TYPE_ISR2, THING_TYPE_PSD, THING_TYPE_ANALOG_METER,
THING_TYPE_GENERATION_METER, THING_TYPE_SMART_METER, THING_TYPE_TWO_WAY_METER)
.collect(Collectors.toSet()));

// List of all Channel ids
public static final String CHANNEL_SWITCH = "switch";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
*/
package org.openhab.binding.innogysmarthome.internal;

import java.util.Collections;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.eclipse.smarthome.config.discovery.DiscoveryService;
import org.eclipse.smarthome.core.thing.Bridge;
Expand All @@ -33,8 +36,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.Sets;

/**
* The {@link InnogyHandlerFactory} is responsible for creating things and thing
* handlers.
Expand All @@ -44,8 +45,9 @@
@Component(service = ThingHandlerFactory.class, configurationPid = "binding.innogysmarthome")
public class InnogyHandlerFactory extends BaseThingHandlerFactory implements ThingHandlerFactory {

private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Sets.union(InnogyBridgeHandler.SUPPORTED_THING_TYPES,
InnogyDeviceHandler.SUPPORTED_THING_TYPES);
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections
.unmodifiableSet(Stream.concat(InnogyBridgeHandler.SUPPORTED_THING_TYPES.stream(),
InnogyDeviceHandler.SUPPORTED_THING_TYPES.stream()).collect(Collectors.toSet()));

private final Logger logger = LoggerFactory.getLogger(InnogyHandlerFactory.class);
private final Map<ThingUID, ServiceRegistration<?>> discoveryServiceRegs = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
*/
package org.openhab.binding.innogysmarthome.internal.client;

import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.eclipse.jdt.annotation.NonNullByDefault;

import com.google.common.collect.ImmutableSet;

/**
* Holds necessary constants for the innogy API.
*
Expand All @@ -28,8 +29,8 @@
public class Constants {

// devices
public static final Set<String> BATTERY_POWERED_DEVICES = ImmutableSet.of("RST", "WRT", "WDS", "WSD", "WSD2", "WMD",
"WMDO", "WSC2", "BRC8");
public static final Set<String> BATTERY_POWERED_DEVICES = Collections.unmodifiableSet(
Stream.of("RST", "WRT", "WDS", "WSD", "WSD2", "WMD", "WMDO", "WSC2", "BRC8").collect(Collectors.toSet()));

// API URLs
public static final String API_HOST = "api.services-smarthome.de";
Expand Down
1 change: 1 addition & 0 deletions bundles/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<module>org.openhab.binding.hyperion</module>
<module>org.openhab.binding.icloud</module>
<module>org.openhab.binding.ihc</module>
<module>org.openhab.binding.innogysmarthome</module>
<module>org.openhab.binding.ipp</module>
<module>org.openhab.binding.irtrans</module>
<module>org.openhab.binding.jeelink</module>
Expand Down
12 changes: 10 additions & 2 deletions features/karaf/openhab-addons/src/main/feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,16 @@

<feature name="openhab-binding-innogysmarthome" description="innogy Smarthome Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<feature>openhab-transport-http</feature>
<bundle start-level="80">mvn:org.openhab.binding/org.openhab.binding.innogysmarthome/${project.version}</bundle>
<feature prerequisite="true">wrap</feature>
<bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/4.4.4</bundle>
<bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/4.5.2</bundle>
<bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-core/2.9.8</bundle>
<bundle dependency="true">mvn:com.google.guava/guava/20.0</bundle>
<bundle dependency="true">mvn:commons-codec/commons-codec/1.10</bundle>
<bundle dependency="true">mvn:com.google.oauth-client/google-oauth-client/1.27.0</bundle>
<bundle dependency="true">mvn:com.google.http-client/google-http-client/1.27.0</bundle>
<bundle dependency="true">wrap:mvn:com.google.http-client/google-http-client-jackson2/1.27.0$Bundle-Name=Jackson%202%20Extensions&amp;Bundle-SymbolicName=com.google.http-client.google-http-client-jackson2&amp;Bundle-Version=1.27.0</bundle>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.innogysmarthome/${project.version}</bundle>
</feature>

<feature name="openhab-binding-irtrans" description="IRTrans Binding" version="${project.version}">
Expand Down

0 comments on commit c99e344

Please sign in to comment.