observedResult : HD_POWERVIEW_APP_OBSERVED_RESULTS.entrySet()) {
+ try {
+ byte[] calculated = new ShadeDataWriter().withPrimary(observedResult.getKey()).getEncrypted(TEST_KEY);
+ byte[] observed = observedResult.getValue();
+ assertEquals(observed[0], calculated[4], 1); // allow error of 1 in LSB for rounding
+ assertEquals(observed[1], calculated[5]);
+
+ } catch (InvalidKeyException | IllegalArgumentException | NoSuchAlgorithmException | NoSuchPaddingException
+ | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
+ fail(e);
+ }
+ }
+ }
+
+ /**
+ * Test that {@code ShadeDataWriter} produces correct values.
+ */
+ @Test
+ void testShadeDataWriter() {
+ try {
+ String actual;
+ String expected;
+
+ // test basic output
+ actual = HexUtils.bytesToHex(new ShadeDataWriter().getEncrypted(TEST_KEY));
+ expected = "1F70847E5C07AD03100E0FB3DA";
+ assertTrue(expected.equals(actual));
+
+ // test sequence number only
+ actual = HexUtils.bytesToHex(new ShadeDataWriter().withSequence((byte) 1).getEncrypted(TEST_KEY));
+ expected = "1F70857E5C07AD03100E0FB3DA";
+ assertTrue(expected.equals(actual));
+
+ // test primary position only
+ actual = HexUtils.bytesToHex(new ShadeDataWriter().withPrimary(100).getEncrypted(TEST_KEY));
+ expected = "1F70847E4CA0AD03100E0FB3DA";
+ assertTrue(expected.equals(actual));
+
+ // test tilt position only
+ actual = HexUtils.bytesToHex(new ShadeDataWriter().withTilt(40).getEncrypted(TEST_KEY));
+ expected = "1F70847E5C07AD03100E2733DA";
+ assertTrue(expected.equals(actual));
+
+ // test sequence number, plus primary position, plus secondary position
+ expected = "1F70227EE48C4580100E0FB3DA";
+ actual = HexUtils.bytesToHex(new ShadeDataWriter().withSequence((byte) 0xa6).withPrimary(30)
+ .withSecondary(10).getEncrypted(TEST_KEY));
+ assertTrue(expected.equals(actual));
+
+ } catch (InvalidKeyException | IllegalArgumentException | NoSuchAlgorithmException | NoSuchPaddingException
+ | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
+ fail(e);
+ }
+ }
+}
diff --git a/bundles/org.openhab.binding.bluetooth/src/main/resources/OH-INF/addon/addon.xml b/bundles/org.openhab.binding.bluetooth/src/main/resources/OH-INF/addon/addon.xml
index 8628a274d33..05e49f6a21c 100644
--- a/bundles/org.openhab.binding.bluetooth/src/main/resources/OH-INF/addon/addon.xml
+++ b/bundles/org.openhab.binding.bluetooth/src/main/resources/OH-INF/addon/addon.xml
@@ -8,4 +8,20 @@
This binding supports the Bluetooth protocol.
local
+
+
+ usb
+
+
+ manufacturer
+ (?i).*bluegiga.*
+
+
+ chipId
+ 0258:0001
+
+
+
+
+
diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/database/ShadeCapabilitiesDatabase.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/database/ShadeCapabilitiesDatabase.java
index 591af5dd9e9..070791cc608 100644
--- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/database/ShadeCapabilitiesDatabase.java
+++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/database/ShadeCapabilitiesDatabase.java
@@ -24,10 +24,17 @@ import org.slf4j.LoggerFactory;
/**
* Class containing the database of all known shade 'types' and their respective 'capabilities'.
- *
+ *
* If user systems detect shade types that are not in the database, then this class can issue logger warning messages
* indicating such absence, and prompting the user to report it to developers so that the database and the respective
* binding functionality can (hopefully) be extended over time.
+ *
+ * NOTA BENE: this database is required by the two bindings listed below. It is maintained here in the former
+ * binding, but it is consumed also by the latter binding. Therefore do NOT delete or modify this file unless you
+ * have carefully checked against regressions in the latter binding.
+ *
HD Powerview binding: 'org.openhab.binding.hdpowerview
+ * HD Powerview Bluetooth Low Energy binding: 'org.openhab.binding.bluetooth.hdpowerview
+ *
*
* @author Andrew Fiddian-Green - Initial Contribution
*/
diff --git a/bundles/pom.xml b/bundles/pom.xml
index 28596db8a28..8cb255be2f8 100644
--- a/bundles/pom.xml
+++ b/bundles/pom.xml
@@ -83,6 +83,7 @@
org.openhab.binding.bluetooth.generic
org.openhab.binding.bluetooth.govee
org.openhab.binding.bluetooth.grundfosalpha
+ org.openhab.binding.bluetooth.hdpowerview
org.openhab.binding.bluetooth.radoneye
org.openhab.binding.bluetooth.roaming
org.openhab.binding.bluetooth.ruuvitag
diff --git a/features/openhab-addons/src/main/resources/footer.xml b/features/openhab-addons/src/main/resources/footer.xml
index eab649b5c39..df421579366 100644
--- a/features/openhab-addons/src/main/resources/footer.xml
+++ b/features/openhab-addons/src/main/resources/footer.xml
@@ -14,6 +14,7 @@
mvn:org.openhab.addons.bundles/org.openhab.binding.bluetooth.generic/${project.version}
mvn:org.openhab.addons.bundles/org.openhab.binding.bluetooth.govee/${project.version}
mvn:org.openhab.addons.bundles/org.openhab.binding.bluetooth.grundfosalpha/${project.version}
+ mvn:org.openhab.addons.bundles/org.openhab.binding.bluetooth.hdpowerview/${project.version}
mvn:org.openhab.addons.bundles/org.openhab.binding.bluetooth.radoneye/${project.version}
mvn:org.openhab.addons.bundles/org.openhab.binding.bluetooth.roaming/${project.version}
mvn:org.openhab.addons.bundles/org.openhab.binding.bluetooth.ruuvitag/${project.version}