Skip to content

Commit

Permalink
comfoair - first version
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Böhm <h.boehm@gmx.at>
  • Loading branch information
boehan committed Feb 22, 2020
1 parent 393fb2d commit b30bfcc
Show file tree
Hide file tree
Showing 26 changed files with 6,670 additions and 1 deletion.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/bundles/org.openhab.binding.buienradar/ @gedejong
/bundles/org.openhab.binding.chromecast/ @kaikreuzer
/bundles/org.openhab.binding.cm11a/ @BobRak
/bundles/org.openhab.binding.comfoair/ @boehan
/bundles/org.openhab.binding.coolmasternet/ @projectgus
/bundles/org.openhab.binding.daikin/ @caffineehacker
/bundles/org.openhab.binding.darksky/ @cweitkamp
Expand Down
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@
<artifactId>org.openhab.binding.cm11a</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.comfoair</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.coolmasternet</artifactId>
Expand Down
32 changes: 32 additions & 0 deletions bundles/org.openhab.binding.comfoair/.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 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="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" 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>
23 changes: 23 additions & 0 deletions bundles/org.openhab.binding.comfoair/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.openhab.binding.comfoair</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.comfoair/NOTICE
Original file line number Diff line number Diff line change
@@ -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/openhab2-addons
899 changes: 899 additions & 0 deletions bundles/org.openhab.binding.comfoair/README.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions bundles/org.openhab.binding.comfoair/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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/xsd/maven-4.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.2-SNAPSHOT</version>
</parent>

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

<name>openHAB Add-ons :: Bundles :: ComfoAir Binding</name>

</project>
10 changes: 10 additions & 0 deletions bundles/org.openhab.binding.comfoair/src/main/feature/feature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.comfoair-${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-comfoair" description="ComfoAir Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<feature>openhab-transport-serial</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.comfoair/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* 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.comfoair.internal;

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

/**
* The {@link ComfoAirBindingConstants} class defines common constants, which are
* used across the whole binding.
*
* @author Hans Böhm - Initial contribution
*/
@NonNullByDefault
public class ComfoAirBindingConstants {

private static final String BINDING_ID = "comfoair";

public static final ThingTypeUID THING_TYPE_COMFOAIR_GENERIC = new ThingTypeUID(BINDING_ID, "comfoair");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/**
* 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.comfoair.internal;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;

/**
* Class to encapsulate all data which is needed to send a cmd to comfoair
*
* @author Holger Hees - Initial Contribution
* @author Hans Böhm - Refactoring
*/
@NonNullByDefault
public class ComfoAirCommand {

private List<String> keys;
private @Nullable Integer requestCmd;
private @Nullable Integer replyCmd;
private int[] requestData;
private @Nullable Integer requestValue;
private @Nullable Integer dataPosition;

/**
* @param key
* command key
* @param requestCmd
* command as byte value
* @param replyCmd
* reply command as byte value
* @param data
* request byte values
* @param requestValue
* request byte value
* @param dataPosition
* request byte position
*/

public ComfoAirCommand(String key, @Nullable Integer requestCmd, @Nullable Integer replyCmd, int[] data,
@Nullable Integer dataPosition, @Nullable Integer requestValue) {
this.keys = new ArrayList<String>();
this.keys.add(key);
this.requestCmd = requestCmd;
this.requestData = data;
this.requestValue = requestValue;
this.dataPosition = dataPosition;
this.replyCmd = replyCmd;
}

/**
* @param key
* additional command key
*/
public void addKey(String key) {
keys.add(key);
}

/**
* @return command keys
*/
public List<String> getKeys() {
return keys;
}

/**
* @return command byte value
*/
public @Nullable Integer getRequestCmd() {
return requestCmd;
}

/**
* @return request data as byte values
*/
public int[] getRequestData() {
return requestData;
}

/**
* @return acknowledge cmd byte value
*/
public @Nullable Integer getReplyCmd() {
return replyCmd;
}

/**
* @return request value as byte value
*/
public @Nullable Integer getRequestValue() {
return requestValue;
}

/**
* @return position of request byte
*/
public @Nullable Integer getDataPosition() {
return dataPosition;
}

/**
* set request command byte value
*/
public void setRequestCmd(@Nullable Integer newRequestCmd) {
requestCmd = newRequestCmd;
}

/**
* set reply command byte value
*/
public void setReplyCmd(@Nullable Integer newReplyCmd) {
replyCmd = newReplyCmd;
}

/**
* set request data byte values
*/
public void setRequestData(int[] newRequestData) {
requestData = newRequestData;
}
}
Loading

0 comments on commit b30bfcc

Please sign in to comment.