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

[linktap] Initial contribution #17235

Merged
merged 47 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4e810ea
[linkTap] Initial Code Commit
dag81 Jun 4, 2024
2b5215b
[linkTap] Initial Code Commit
dag81 Jun 4, 2024
1729cf3
[linkTap] Rebased to main
dag81 Aug 12, 2024
727756f
[linkTap] Initial code commit.
dag81 Aug 12, 2024
0c404fd
Merge branch 'openhab:main' into bindinngs/linkTap
dag81 Aug 13, 2024
1c7d594
[linkTap] PR Prep Updates
dag81 Aug 13, 2024
38b67d0
[linkTap] PR Feedback 1
dag81 Sep 9, 2024
e129d3f
[linkTap] PR Feedback 2
dag81 Sep 10, 2024
f0c2b9a
[linkTap] PR Feedback 3
dag81 Sep 10, 2024
b65fd0c
[linkTap] PR Feedback 3
dag81 Sep 10, 2024
44ca841
[linkTap] PR Feedback 4
dag81 Sep 10, 2024
d2033ca
[linkTap] PR Feedback 5
dag81 Sep 10, 2024
ca162c4
[linkTap] PR Feedback 6
dag81 Sep 10, 2024
30e07e2
[linkTap] PR Feedback 7
dag81 Sep 10, 2024
16db8c2
[linkTap] PR Feedback 8
dag81 Sep 10, 2024
7ef4aa9
[linkTap] FW Ver req updated
dag81 Sep 10, 2024
12e4dc6
[linkTap] Corrections for equals invokes
dag81 Sep 19, 2024
3049591
[linkTap] Names and casting
dag81 Sep 19, 2024
0cbbed8
[linkTap] PR Adjustments 1 pass 2
dag81 Sep 19, 2024
14241d2
[linkTap] PR Adjustments 2 pass 2
dag81 Sep 19, 2024
fc13f15
[linkTap] PR Adjustments 3 pass 2
dag81 Sep 19, 2024
a1b5c1b
[linkTap] PR Adjustments 4 pass 2
dag81 Sep 19, 2024
c972cab
[linkTap] PR Adjustments 4 pass 2
dag81 Sep 19, 2024
abb6c6d
[linkTap] PR Adjustments 4 pass 2
dag81 Sep 20, 2024
9df7426
[linkTap] PR Adjustments 5 pass 2
dag81 Sep 20, 2024
cf2fe18
[linkTap] PR Adjustments 6 pass 2
dag81 Sep 20, 2024
e054ac7
[linkTap] PR Adjustments 7 pass 2
dag81 Sep 20, 2024
702ecbb
[linkTap] PR Adjustments 8 pass 2
dag81 Sep 20, 2024
930ec2c
[linkTap] i18 http warning addition
dag81 Sep 20, 2024
be6cff6
[linkTap] i18 http warning addition 2
dag81 Sep 22, 2024
583986b
[linkTap] i18 firmware version update
dag81 Sep 24, 2024
b77fa67
[linkTap] Updated to use framework unit conversions
dag81 Sep 24, 2024
c7f35e8
[linkTap] debug removal, i18n and flow correction for local addr dete…
dag81 Sep 24, 2024
e46524d
[linkTap] more i18n additions
dag81 Sep 24, 2024
958fb30
[linkTap] i18 http warning additions
dag81 Sep 24, 2024
a688dca
[linkTap] i18 http warning additions
dag81 Sep 24, 2024
e15b9bb
[linkTap] i18 http warning additions
dag81 Sep 24, 2024
ee0225b
[linkTap] i18 http warning additions
dag81 Sep 27, 2024
1369384
[linkTap] i18 wip upload
dag81 Sep 28, 2024
fae4e2b
[linkTap] i18 tns exception
dag81 Sep 28, 2024
db14b14
[linkTap] i18 again
dag81 Sep 28, 2024
79e2d53
[linkTap] i18 cleanups
dag81 Sep 28, 2024
c2ea4ed
[linkTap] further i18n
dag81 Sep 28, 2024
ac396bc
[linkTap] i18 cleanups
dag81 Sep 28, 2024
f7e46bf
[linkTap] variable sortout
dag81 Sep 29, 2024
1420f3a
[linkTap] compiler import warn fixes
dag81 Sep 29, 2024
eb462ea
[linkTap] generic exception addition
dag81 Sep 29, 2024
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
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,11 @@
<artifactId>org.openhab.binding.lifx</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.linktap</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.linky</artifactId>
Expand Down
20 changes: 20 additions & 0 deletions bundles/org.openhab.binding.linktap/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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

== Third-party Content

jsoup
* License: MIT License
* Project: https://jsoup.org/
* Source: https://github.com/jhy/jsoup
235 changes: 235 additions & 0 deletions bundles/org.openhab.binding.linktap/README.md

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions bundles/org.openhab.binding.linktap/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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 https://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>4.3.0-SNAPSHOT</version>
</parent>

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

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

<properties>
<jsoup.version>1.15.4</jsoup.version>
</properties>

<dependencies>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>${jsoup.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
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.linktap-${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-linktap" description="LinkTap Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle dependency="true">mvn:org.jsoup/jsoup/1.15.4</bundle>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.linktap/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2010-2024 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.linktap.configuration;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link LinkTapBridgeConfiguration} class contains fields mapping bridge configuration parameters.
*
* @author David Goodyear - Initial contribution
*/
@NonNullByDefault
public class LinkTapBridgeConfiguration {

public String host = "";
public String username = "";
public String password = "";
public boolean enableMDNS = true;
public boolean enableJSONComms = false;
lsiepel marked this conversation as resolved.
Show resolved Hide resolved
public boolean enforceProtocolLimits = true;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Copyright (c) 2010-2024 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.linktap.configuration;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link LinkTapDeviceConfiguration} class contains fields mapping the configuration parameters for a LinkTap
* device's configuration.
*
* @author David Goodyear - Initial contribution
*/
@NonNullByDefault
public class LinkTapDeviceConfiguration {

/**
* The clear text device name as reported by the API.
*/
public String name = "";

/**
* The device id as stored by the gateway to address the device.
*/
public String id = "";

/**
* If enabled the device, will enable all alerts during device initialization.
*/
public boolean enableAlerts = true;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Copyright (c) 2010-2024 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.linktap.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link DeviceMetaDataUpdatedHandler} enables call-backs for when the device meta-data is updated from a bridge.
*
* @author David Goodyear - Initial contribution
*/
@NonNullByDefault
public interface DeviceMetaDataUpdatedHandler {
/**
* Any registered metadata handlers, will have this
* invoked after new configuration data has been retrieved from the GW.
*
* An example use is for the discovery service to refresh its data based on received
* new configuration data of devices attached to a GW.
*/
void handleMetadataRetrieved(LinkTapBridgeHandler handler);
lsiepel marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
* Copyright (c) 2010-2024 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.linktap.internal;

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

/**
* The {@link Firmware} class defines the firmware version.
*
* @author David Goodyear - Initial contribution
*/
@NonNullByDefault
public class Firmware {
String raw;
int buildVer;
int hwVer;

public Firmware(final @Nullable String fwVersion) {
raw = "S00000000";
hwVer = 0;
buildVer = 0;

if (fwVersion == null || fwVersion.length() < 7) {
return;
} else {
raw = fwVersion;
buildVer = Integer.parseInt(raw.substring(1, 7));
lsiepel marked this conversation as resolved.
Show resolved Hide resolved
}

switch (fwVersion.charAt(0)) {
case 'G':
hwVer = 2;
break;
case 'S':
hwVer = 1;
break;
default:
break;
}
}

public boolean supportsLocalConfig() {
return buildVer >= 60883;
}

public boolean supportsMDNS() {
return buildVer >= 60880;
}

public String generateTestedRevisionForHw(final int versionNo) {
return String.format("%c%05d", raw.charAt(0), versionNo);
}

public String getRecommendedMinVer() {
return generateTestedRevisionForHw(60883);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2010-2024 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.linktap.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* Defines a interface that Things under the Bridge can implement to receive
* callbacks, when the bridges configuration data has been updated.
*
* @author David Goodyear - Initial contribution
*/
@NonNullByDefault
public interface IBridgeData {

/**
* Any things under a Bridge that implement this interface, will have this
* invoked after new configuration data has been retrieved from the GW.
*/
void handleBridgeDataUpdated();
lsiepel marked this conversation as resolved.
Show resolved Hide resolved
}
Loading