Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial contribution of the KNX Basic binding #2323

Merged
merged 52 commits into from
Mar 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5523565
initial contribution of the KNX Basic binding
Jun 1, 2017
bc2d963
dropped specialized numeric types
Jun 6, 2017
5d840a0
review feedback
Dec 11, 2017
108890d
factored knx client communication out of bridge handler
Dec 12, 2017
88a340e
updated pom
Dec 12, 2017
fca642d
review feedbacks
Dec 20, 2017
da3d8e6
changed configuration syntax
Dec 23, 2017
6711347
added knx test project
Dec 23, 2017
1b698e4
updated versions to 2.3.0-SNAPSHOT
Dec 23, 2017
8d5b4ff
control types, renamings
Jan 2, 2018
94b0a53
KNXCoreTypeMapper adaptions
Jan 5, 2018
0ef0379
javadocs, license headers and minor cleanups
Jan 5, 2018
14c6aab
piggyback on system profiles
Jan 8, 2018
2dda7a1
fix read requests by removing the length check
Jan 8, 2018
9b88b09
take over fix for PercentType
Jan 8, 2018
67d16ec
fixed static code analysis complaints
Jan 8, 2018
2467685
added karaf feature
Jan 8, 2018
df55b6d
don't export calimero packages for now
Jan 8, 2018
f601393
incorporated review feedback
Jan 26, 2018
81b1303
review feedback
Feb 26, 2018
32951b2
update license headers
Feb 26, 2018
d27ddb4
fixed TODOs in README
Feb 26, 2018
d787129
fixed log statement
Feb 26, 2018
5a000cc
added items to the control example
Feb 26, 2018
925419d
muting calimero unless debugging
Feb 26, 2018
43d16bf
set thing status to UNKNOWN until reached out to the device
Mar 5, 2018
93ffa91
don't disconnect in case of a sending error
Mar 5, 2018
58cb385
fix tabs in README
Mar 5, 2018
c84a9da
fixed message format pattern
Mar 5, 2018
565f9b6
added missing @Override annotations
Mar 5, 2018
c82cb43
drop flaky (and unused) memory reading
Mar 5, 2018
b1c3a72
fix NPE in case a device doesn't return a property
Mar 5, 2018
d511c89
do reachable check quicker, separate from property reading
Mar 5, 2018
f313bb8
excluded README from binary
Mar 5, 2018
ef73790
renamed headlines: channels -> channel types
Mar 5, 2018
0f21fbc
lower-case channel type headlines
Mar 5, 2018
d4c4070
clarified that control channels do not send read requests to the bus
Mar 5, 2018
e4ec9e8
moved the read request explanation down, into the notation section
Mar 5, 2018
f4f6329
run device ping and property feching serially in a single thread
Mar 7, 2018
afa845f
optimize (i.e. reduce) some log levels
Mar 7, 2018
e005ff4
fix ISE when bridge goes offline
Mar 7, 2018
507bc14
relative -> absolute position
Mar 7, 2018
cdb1f29
switch -> ga
Mar 7, 2018
fea2c79
switch -> ga (part 2)
Mar 7, 2018
6b7c0de
Added file description and specific mapping's
lewie Mar 8, 2018
c07158e
update to calimero 2.4 snapshot
Mar 8, 2018
ce37392
properly detach the response communicator
Mar 8, 2018
6a5a91b
do read requests in the main knx scheduler
Mar 8, 2018
2541ca4
add missing @Overrides
Mar 8, 2018
dfe0357
switch -> ga (part 3)
Mar 8, 2018
aef5467
fixed missing import for csalimero 2.4
Mar 10, 2018
b8cac0f
avoid calimero's localized number serialization
Mar 15, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions addons/binding/org.openhab.binding.knx.test/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="output" path="target/test-classes"/>
</classpath>
28 changes: 28 additions & 0 deletions addons/binding/org.openhab.binding.knx.test/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.openhab.binding.knx.test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
27 changes: 27 additions & 0 deletions addons/binding/org.openhab.binding.knx.test/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: KNX Binding Tests
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-SymbolicName: org.openhab.binding.knx.test;singleton:=true
Bundle-Vendor: openHAB
Bundle-Version: 2.3.0.qualifier
Export-Package: org.openhab.binding.knx;uses:="org.eclipse.smarthome.test"
Fragment-Host: org.openhab.binding.knx
Import-Package:
org.openhab.binding.knx,
org.openhab.binding.knx.handler,
org.eclipse.jdt.annotation;resolution:=optional,
org.eclipse.smarthome.core.common.registry,
org.eclipse.smarthome.core.events,
org.eclipse.smarthome.core.thing,
org.eclipse.smarthome.core.thing.binding,
org.eclipse.smarthome.core.thing.binding.builder,
org.eclipse.smarthome.core.thing.util,
org.eclipse.smarthome.test.java,
org.eclipse.smarthome.test.storage,
org.hamcrest;core=split,
org.junit;version="4.0.0",
org.mockito,
org.osgi.framework,
org.osgi.service.device,
org.slf4j
32 changes: 32 additions & 0 deletions addons/binding/org.openhab.binding.knx.test/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>

<p>March 30, 2017</p>
<h3>License</h3>

<p>
The openHAB community makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.
</p>

<p>
If you did not receive this Content directly from the openHAB community, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.openhab.org/">openhab.org</a>.
</p>

</body>
</html>
5 changes: 5 additions & 0 deletions addons/binding/org.openhab.binding.knx.test/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source.. = src/test/java/
output.. = target/test-classes
bin.includes = META-INF/,\
.,\
about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
<booleanAttribute key="append.args" value="true"/>
<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
<booleanAttribute key="askclear" value="false"/>
<booleanAttribute key="automaticAdd" value="false"/>
<booleanAttribute key="automaticValidate" value="false"/>
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
<booleanAttribute key="clearConfig" value="true"/>
<booleanAttribute key="clearws" value="true"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="false"/>
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/org.openhab.binding.knx.test/src/test/java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.openhab.binding.knx.test/src\/test\/java"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.openhab.binding.knx.test"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.equinox.p2.director.app.product"/>
<booleanAttribute key="run_in_ui_thread" value="false"/>
<stringAttribute key="selected_target_plugins" value="ch.qos.logback.classic@default:default,ch.qos.logback.core@default:default,ch.qos.logback.slf4j@default:false,com.eclipsesource.jaxrs.jersey-all@default:default,com.google.gson*2.2.4.v201311231704@default:default,com.google.gson*2.2.4@default:default,com.google.guava@default:default,com.google.inject@default:default,com.ibm.icu.base@default:default,javax.annotation@default:default,javax.inject@default:default,javax.servlet*3.0.0.v201112011016@default:default,javax.transaction@default:false,javax.xml@default:default,org.antlr.runtime@default:default,org.apache.ant@default:default,org.apache.batik.css@default:default,org.apache.batik.util.gui@default:default,org.apache.batik.util@default:default,org.apache.commons.codec@default:default,org.apache.commons.collections@default:default,org.apache.commons.exec@default:default,org.apache.commons.httpclient@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.net@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.codehaus.groovy@default:default,org.eclipse.ant.core@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.java7@default:false,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources.win32.x86_64@default:false,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.event@default:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.region@default:false,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.transforms.hook@default:false,org.eclipse.equinox.util@default:default,org.eclipse.equinox.weaving.hook@default:false,org.eclipse.help@default:default,org.eclipse.jetty.http*9.2.1.v20140609@default:default,org.eclipse.jetty.io*9.2.1.v20140609@default:default,org.eclipse.jetty.osgi.npn.fragment@default:false,org.eclipse.jetty.rewrite@default:default,org.eclipse.jetty.server*9.2.1.v20140609@default:default,org.eclipse.jetty.util*9.2.1.v20140609@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.smarthome.config.core@2:true,org.eclipse.smarthome.config.discovery@default:default,org.eclipse.smarthome.config.dispatch@default:default,org.eclipse.smarthome.config.xml@default:default,org.eclipse.smarthome.core.autoupdate@default:default,org.eclipse.smarthome.core.binding.xml@default:default,org.eclipse.smarthome.core.library@default:default,org.eclipse.smarthome.core.persistence@default:default,org.eclipse.smarthome.core.scheduler@default:default,org.eclipse.smarthome.core.scriptengine@default:default,org.eclipse.smarthome.core.thing.xml@default:default,org.eclipse.smarthome.core.thing@default:default,org.eclipse.smarthome.core.transform@default:default,org.eclipse.smarthome.core@default:default,org.eclipse.smarthome.io.console@default:default,org.eclipse.smarthome.io.net@default:default,org.eclipse.smarthome.model.core@default:default,org.eclipse.smarthome.model.item.runtime@default:default,org.eclipse.smarthome.model.item@default:default,org.eclipse.smarthome.model.persistence@default:default,org.eclipse.smarthome.model.rule.runtime@default:default,org.eclipse.smarthome.model.rule@default:default,org.eclipse.smarthome.model.script.runtime,org.eclipse.smarthome.model.script@default:default,org.eclipse.smarthome.model.sitemap.runtime@default:default,org.eclipse.smarthome.model.sitemap@default:default,org.eclipse.smarthome.model.thing.runtime,org.eclipse.smarthome.model.thing@default:default,org.eclipse.smarthome.storage.mapdb@default:default,org.eclipse.smarthome.test@2:default,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.team.core@default:default,org.eclipse.ui.trace@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtext.common.types@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext.xbase@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.junit@default:default,org.jupnp@default:default,org.objectweb.asm@default:default,org.slf4j.api@default:default,org.slf4j.jcl@default:default,org.slf4j.jul@default:default,org.slf4j.log4j@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil@default:default,org.w3c.dom.svg@default:default"/>
<stringAttribute key="selected_workspace_plugins" value="org.openhab.binding.knx.test@default:false,org.openhab.binding.knx@5:default"/>
<booleanAttribute key="show_selected_only" value="true"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="false"/>
<booleanAttribute key="useProduct" value="false"/>
</launchConfiguration>
118 changes: 118 additions & 0 deletions addons/binding/org.openhab.binding.knx.test/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<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/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.binding</groupId>
<artifactId>pom</artifactId>
<version>2.3.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.knx.test</artifactId>
<packaging>eclipse-test-plugin</packaging>

<name>knx Binding Tests</name>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<environments combine.self="override"></environments>
<dependency-resolution>
<extraRequirements>
<dependency>
<type>eclipse-plugin</type>
<id>org.eclipse.equinox.event</id>
<versionRange>0.0.0</versionRange>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<id>org.eclipse.equinox.ds</id>
<versionRange>0.0.0</versionRange>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<id>org.eclipse.smarthome.config.xml</id>
<versionRange>0.0.0</versionRange>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<id>org.eclipse.smarthome.core.thing.xml</id>
<versionRange>0.0.0</versionRange>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<id>org.eclipse.smarthome.core.binding.xml</id>
<versionRange>0.0.0</versionRange>
</dependency>
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<dependencies>
<dependency>
<type>eclipse-plugin</type>
<artifactId>ch.qos.logback.classic</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>ch.qos.logback.core</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>ch.qos.logback.slf4j</artifactId>
<version>0.0.0</version>
</dependency>
</dependencies>
<bundleStartLevel>
<bundle>
<id>org.eclipse.equinox.ds</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.equinox.event</id>
<level>2</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.smarthome.core</id>
<level>4</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.smarthome.core.thing</id>
<level>4</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.smarthome.config.xml</id>
<level>4</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.smarthome.core.thing.xml</id>
<level>4</level>
<autoStart>true</autoStart>
</bundle>
<bundle>
<id>org.eclipse.smarthome.core.binding.xml</id>
<level>4</level>
<autoStart>true</autoStart>
</bundle>
</bundleStartLevel>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/**
* Copyright (c) 2010-2018 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.openhab.binding.knx.internal.channel;

import static org.junit.Assert.*;

import java.util.Collections;
import java.util.Set;

import org.eclipse.jdt.annotation.NonNull;
import org.junit.Before;
import org.junit.Test;

/**
*
* @author Simon Kaufmann - initial contribution and API.
*
*/
public class KNXChannelTypeTest {

private KNXChannelType ct;

@Before
public void setup() {
ct = new MyKNXChannelType("");
}

@Test
public void testParse_withDPT_multiple_withRead() {
ChannelConfiguration res = ct.parse("5.001:<1/3/22+0/3/22+<0/8/15");

assertEquals("5.001", res.getDPT());
assertEquals("1/3/22", res.getMainGA().getGA());
assertTrue(res.getMainGA().isRead());
assertEquals(3, res.getListenGAs().size());
assertEquals(2, res.getReadGAs().size());
}

@Test
public void testParse_withDPT_multiple_withoutRead() {
ChannelConfiguration res = ct.parse("5.001:1/3/22+0/3/22+0/8/15");

assertEquals("5.001", res.getDPT());
assertEquals("1/3/22", res.getMainGA().getGA());
assertFalse(res.getMainGA().isRead());
assertEquals(3, res.getListenGAs().size());
assertEquals(0, res.getReadGAs().size());
}

@Test
public void testParse_withoutDPT_single_withoutRead() {
ChannelConfiguration res = ct.parse("1/3/22");

assertNull(res.getDPT());
assertEquals("1/3/22", res.getMainGA().getGA());
assertFalse(res.getMainGA().isRead());
assertEquals(1, res.getListenGAs().size());
assertEquals(0, res.getReadGAs().size());
}

@Test
public void testParse_withoutDPT_single_witRead() {
ChannelConfiguration res = ct.parse("<1/3/22");

assertNull(res.getDPT());
assertEquals("1/3/22", res.getMainGA().getGA());
assertTrue(res.getMainGA().isRead());
assertEquals(1, res.getListenGAs().size());
assertEquals(1, res.getReadGAs().size());
}

private static class MyKNXChannelType extends KNXChannelType {
public MyKNXChannelType(String channelTypeID) {
super(channelTypeID);
}

@Override
protected @NonNull Set<@NonNull String> getAllGAKeys() {
return Collections.emptySet();
}

@Override
protected @NonNull String getDefaultDPT(@NonNull String gaConfigKey) {
return "";
}

}

}
10 changes: 10 additions & 0 deletions addons/binding/org.openhab.binding.knx/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="lib" path="lib/calimero-core-2.4-e9975c01.jar"/>
<classpathentry kind="lib" path="lib/calimero-device-2.4-a03cd243.jar"/>
<classpathentry kind="lib" path="lib/calimero-rxtx-2.4-883497d1.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Loading