Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into openhab#13456-hue-c…
Browse files Browse the repository at this point in the history
…lip2
  • Loading branch information
andrewfg committed Mar 1, 2023
2 parents 6e329fb + b2bf725 commit 6a01400
Show file tree
Hide file tree
Showing 453 changed files with 10,473 additions and 5,796 deletions.
5 changes: 3 additions & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
/bundles/org.openhab.binding.siemensrds/ @andrewfg
/bundles/org.openhab.binding.silvercrestwifisocket/ @jmvaz
/bundles/org.openhab.binding.sinope/ @chaton78
/bundles/org.openhab.binding.sleepiq/ @syphr42
/bundles/org.openhab.binding.sleepiq/ @syphr42 @mhilbush
/bundles/org.openhab.binding.smaenergymeter/ @monnimeter
/bundles/org.openhab.binding.smartmeter/ @msteigenberger
/bundles/org.openhab.binding.smartthings/ @BobRak
Expand Down Expand Up @@ -339,7 +339,7 @@
/bundles/org.openhab.binding.touchwand/ @roieg
/bundles/org.openhab.binding.tplinkrouter/ @olivierkeke
/bundles/org.openhab.binding.tplinksmarthome/ @Hilbrand
/bundles/org.openhab.binding.tr064/ @openhab/add-ons-maintainers
/bundles/org.openhab.binding.tr064/ @J-N-K
/bundles/org.openhab.binding.tradfri/ @cweitkamp @kaikreuzer
/bundles/org.openhab.binding.twitter/ @computergeek1507
/bundles/org.openhab.binding.unifi/ @mgbowman @Hilbrand
Expand Down Expand Up @@ -399,6 +399,7 @@
/bundles/org.openhab.transform.jsonpath/ @clinique
/bundles/org.openhab.transform.map/ @openhab/add-ons-maintainers
/bundles/org.openhab.transform.regex/ @openhab/add-ons-maintainers
/bundles/org.openhab.transform.rollershutterposition/ @jsjames
/bundles/org.openhab.transform.scale/ @clinique
/bundles/org.openhab.transform.xpath/ @openhab/add-ons-maintainers
/bundles/org.openhab.transform.xslt/ @openhab/add-ons-maintainers
Expand Down
10 changes: 10 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@
<artifactId>org.openhab.binding.bluetooth.govee</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.bluetooth.radoneye</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.bluetooth.roaming</artifactId>
Expand Down Expand Up @@ -1986,6 +1991,11 @@
<artifactId>org.openhab.transform.regex</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.transform.rollershutterposition</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.transform.scale</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.automation.jsscripting/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</bnd.importpackage>
<graal.version>22.0.0.2</graal.version> <!-- DO NOT UPGRADE: 22.0.0.2 is the latest version working on armv7l / OpenJDK 11.0.16 & armv7l / Zulu 17.0.5+8 -->
<oh.version>${project.version}</oh.version>
<ohjs.version>openhab@4.0.0</ohjs.version>
<ohjs.version>openhab@4.1.0</ohjs.version>
</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public void scopeValues(ScriptEngine scriptEngine, Map<String, Object> scopeValu
if (!SCRIPT_TYPES.contains(scriptType)) {
return null;
}
return new DebuggingGraalScriptEngine<>(
new OpenhabGraalJSScriptEngine(injectionEnabled, useIncludedLibrary, jsScriptServiceUtil));
return new DebuggingGraalScriptEngine<>(new OpenhabGraalJSScriptEngine(injectionEnabled, useIncludedLibrary,
jsScriptServiceUtil, jsDependencyTracker));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public class OpenhabGraalJSScriptEngine
* lifecycle and provides hooks for scripts to do so too.
*/
public OpenhabGraalJSScriptEngine(boolean injectionEnabled, boolean useIncludedLibrary,
JSScriptServiceUtil jsScriptServiceUtil) {
JSScriptServiceUtil jsScriptServiceUtil, JSDependencyTracker jsDependencyTracker) {
super(null); // delegate depends on fields not yet initialised, so we cannot set it immediately
this.injectionEnabled = injectionEnabled;
this.useIncludedLibrary = useIncludedLibrary;
Expand All @@ -149,7 +149,8 @@ public OpenhabGraalJSScriptEngine(boolean injectionEnabled, boolean useIncludedL

delegate = GraalJSScriptEngine.create(ENGINE,
Context.newBuilder("js").allowExperimentalOptions(true).allowAllAccess(true)
.allowHostAccess(HOST_ACCESS).option("js.commonjs-require-cwd", JSDependencyTracker.LIB_PATH)
.allowHostAccess(HOST_ACCESS)
.option("js.commonjs-require-cwd", jsDependencyTracker.getLibraryPath().toString())
.option("js.nashorn-compat", "true") // Enable Nashorn compat mode as openhab-js relies on
// accessors, see
// https://github.com/oracle/graaljs/blob/master/docs/user/NashornMigrationGuide.md#accessors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
package org.openhab.automation.jsscripting.internal.fs.watch;

import java.io.File;
import java.nio.file.Files;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.automation.module.script.ScriptDependencyTracker;
Expand All @@ -40,15 +39,11 @@ public class JSDependencyTracker extends AbstractScriptDependencyTracker {

private final Logger logger = LoggerFactory.getLogger(JSDependencyTracker.class);

public static final String LIB_PATH = String.join(File.separator, "automation", "js", "node_modules");
private static final String LIB_PATH = String.join(File.separator, "automation", "js", "node_modules");

@Activate
public JSDependencyTracker(@Reference(target = WatchService.CONFIG_WATCHER_FILTER) WatchService watchService) {
super(watchService, LIB_PATH);

if (Files.isRegularFile(this.libraryPath)) {
logger.warn("Trying to watch directory '{}', however it is a file", this.libraryPath);
}
}

@Deactivate
Expand Down
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.bluetooth.radoneye/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/openhab-addons
47 changes: 47 additions & 0 deletions bundles/org.openhab.binding.bluetooth.radoneye/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# radoneye

This extension adds support for [RadonEye](http://radonftlab.com/radon-sensor-product/radon-detector/rd200/) radon bluetooth detector.

## Supported Things

Following thing types are supported by this extension:

| Thing Type ID | Description |
| ------------------- | -------------------------------------- |
| radoneye_rd200 | Original RadonEye (RD200) |

## Discovery

As any other Bluetooth device, RadonEye devices are discovered automatically by the corresponding bridge.

## Thing Configuration

Supported configuration parameters for the things:

| Property | Type | Default | Required | Description |
|---------------------------------|---------|---------|----------|-----------------------------------------------------------------|
| address | String | | Yes | Bluetooth address of the device (in format "XX:XX:XX:XX:XX:XX") |
| refreshInterval | Integer | 300 | No | How often a refresh shall occur in seconds |

## Channels

Following channels are supported for `RadonEye` thing:

| Channel ID | Item Type | Description |
| ------------------ | ------------------------ | ------------------------------------------- |
| radon | Number:Density | The measured radon level |


## Example

radoneye.things (assuming you have a Bluetooth bridge with the ID `bluetooth:bluegiga:adapter1`:

```
bluetooth:radoneye_rd200:adapter1:sensor1 "radoneye Wave Plus Sensor 1" (bluetooth:bluegiga:adapter1) [ address="12:34:56:78:9A:BC", refreshInterval=300 ]
```

radoneye.items:

```
Number:Density radon "Radon level [%d %unit%]" { channel="bluetooth:radoneye_rd200:adapter1:sensor1:radon" }
```
25 changes: 25 additions & 0 deletions bundles/org.openhab.binding.bluetooth.radoneye/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.bluetooth.radoneye</artifactId>

<name>openHAB Add-ons :: Bundles :: RadonEye Bluetooth Adapter</name>

<dependencies>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.bluetooth</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.bluetooth.radoneye-${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-bluetooth-radoneye" description="Bluetooth Binding RadonEye" 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.bluetooth/${project.version}</bundle>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.bluetooth.radoneye/${project.version}</bundle>
</feature>

</features>
Loading

0 comments on commit 6a01400

Please sign in to comment.