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

update fork #7

Merged
merged 18 commits into from
Jul 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
/bundles/org.openhab.binding.bsblan/ @hypetsch
/bundles/org.openhab.binding.bticinosmarther/ @MrRonfo
/bundles/org.openhab.binding.buienradar/ @gedejong
/bundles/org.openhab.binding.caddx/ @jossuar
/bundles/org.openhab.binding.chromecast/ @kaikreuzer
/bundles/org.openhab.binding.cm11a/ @BobRak
/bundles/org.openhab.binding.coolmasternet/ @projectgus
Expand Down
7 changes: 6 additions & 1 deletion bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bom</groupId>
<artifactId>org.openhab.addons.reactor.bom</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.addons.bom.openhab-addons</artifactId>
Expand Down Expand Up @@ -144,6 +144,11 @@
<artifactId>org.openhab.binding.buienradar</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.caddx</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.chromecast</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom/openhab-core-index/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bom</groupId>
<artifactId>org.openhab.addons.reactor.bom</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.addons.bom.openhab-core-index</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons</groupId>
<artifactId>org.openhab.addons.reactor</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<groupId>org.openhab.addons.bom</groupId>
Expand Down
2 changes: 1 addition & 1 deletion bom/runtime-index/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bom</groupId>
<artifactId>org.openhab.addons.reactor.bom</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.addons.bom.runtime-index</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom/test-index/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bom</groupId>
<artifactId>org.openhab.addons.reactor.bom</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.addons.bom.test-index</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/create_openhab_binding_skeleton.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ IF %ARGC% NEQ 3 (
)

SET OpenhabCoreVersion="2.5.0"
SET OpenhabVersion="2.5.7-SNAPSHOT"
SET OpenhabVersion="2.5.8-SNAPSHOT"

SET BindingIdInCamelCase=%~1
SET BindingIdInLowerCase=%BindingIdInCamelCase%
Expand Down
2 changes: 1 addition & 1 deletion bundles/create_openhab_binding_skeleton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[ $# -lt 3 ] && { echo "Usage: $0 <BindingIdInCamelCase> <Author> <GitHub Username>"; exit 1; }

openHABCoreVersion=2.5.0
openHABVersion=2.5.7-SNAPSHOT
openHABVersion=2.5.8-SNAPSHOT

camelcaseId=$1
id=`echo $camelcaseId | tr '[:upper:]' '[:lower:]'`
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.adorne/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.adorne</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.airquality/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.airquality</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.airvisualnode/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.airvisualnode</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.alarmdecoder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.alarmdecoder</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.allplay/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.allplay</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.amazondashbutton/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.amazondashbutton</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.amazonechocontrol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.amazonechocontrol</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,16 @@ public Connection(@Nullable Connection oldConnection, Gson gson) {
this.deviceId = deviceId;
} else {
// generate device id
StringBuilder deviceIdBuilder = new StringBuilder();
for (int i = 0; i < 64; i++) {
deviceIdBuilder.append(rand.nextInt(9));
}
deviceIdBuilder.append("23413249564c5635564d32573831");
this.deviceId = deviceIdBuilder.toString();
byte[] bytes = new byte[16];
rand.nextBytes(bytes);
String hexStr = HexUtils.bytesToHex(bytes).toUpperCase();
this.deviceId = HexUtils.bytesToHex(hexStr.getBytes()) + "23413249564c5635564d32573831";
}

// build user agent
this.userAgent = "AmazonWebView/Amazon Alexa/2.2.223830.0/iOS/11.4.1/iPhone";

// setAmazonSite(amazonSite);

GsonBuilder gsonBuilder = new GsonBuilder();
gsonWithNullSerialization = gsonBuilder.create();
}
Expand Down Expand Up @@ -836,10 +833,14 @@ public String getLoginPage() throws IOException, URISyntaxException {
cookieManager.getCookieStore().add(new URI("https://www.amazon.com"), new HttpCookie("map-md", mapMdCookie));
cookieManager.getCookieStore().add(new URI("https://www.amazon.com"), new HttpCookie("frc", frc));

String loginFormHtml = makeRequestAndReturnString("https://www.amazon.com"
Map<String, String> customHeaders = new HashMap<>();
customHeaders.put("authority", "www.amazon.com");
String loginFormHtml = makeRequestAndReturnString("GET",
"https://www.amazon.com"
+ "/ap/signin?openid.return_to=https://www.amazon.com/ap/maplanding&openid.assoc_handle=amzn_dp_project_dee_ios&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&pageId=amzn_dp_project_dee_ios&accountStatusPolicy=P1&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.mode=checkid_setup&openid.ns.oa2=http://www.amazon.com/ap/ext/oauth/2&openid.oa2.client_id=device:"
+ deviceId
+ "&openid.ns.pape=http://specs.openid.net/extensions/pape/1.0&openid.oa2.response_type=token&openid.ns=http://specs.openid.net/auth/2.0&openid.pape.max_auth_age=0&openid.oa2.scope=device_auth_access");
+ "&openid.ns.pape=http://specs.openid.net/extensions/pape/1.0&openid.oa2.response_type=token&openid.ns=http://specs.openid.net/auth/2.0&openid.pape.max_auth_age=0&openid.oa2.scope=device_auth_access",
null, false, customHeaders);

logger.debug("Received login form {}", loginFormHtml);
return loginFormHtml;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ public void close() {
sessionFuture.cancel(true);
}
try {
if (webSocketClient.isStarted()) {
webSocketClient.stop();
}
webSocketClient.stop();
} catch (InterruptedException e) {
// Just ignore
} catch (Exception e) {
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.ambientweather/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.ambientweather</artifactId>
Expand Down
60 changes: 60 additions & 0 deletions bundles/org.openhab.binding.astro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,66 @@ then
end
```

## Rule Actions

Multiple actions are supported by this binding. In classic rules these are accessible as shown in the example below:

Getting sunActions variable in scripts

```
val sunActions = getActions("astro","astro:sun:local")
if(null === sunActions) {
logInfo("actions", "sunActions not found, check thing ID")
return
} else {
// do something with sunActions
}
```

### getEventTime(sunPhaseName, moment, date)

Retrieves date and time (ZonedDateTime) of the requested phase name.
Thing method only applies to Sun thing type.

* `sunPhaseName` (String), values: `SUN_RISE, ASTRO_DAWN, NAUTIC_DAWN, CIVIL_DAWN, CIVIL_DUSK, NAUTIC_DUSK, ASTRO_DUSK, SUN_SET, DAYLIGHT, NIGHT`. Mandatory.

* `date` (ZonedDateTime), only the date part of this parameter will be considered - defaulted to now() if null.

* `moment` (String), values: `START, END` - defaulted to `START` if null.

Example :

```
val sunEvent = "SUN_SET"
val today = ZonedDateTime.now;
val sunEventTime = sunActions.getEventTime(sunEvent,today,"START")
logInfo("AstroActions","{} will happen at : {}", sunEvent, sunEventTime.toString)
```

### getElevation(timeStamp)

Retrieves the elevation (QuantityType<Angle>) of the sun at the requested instant.
Thing method applies to Sun and Moon.

* `timeStamp` (ZonedDateTime) - defaulted to now() if null.


### getAzimuth(timeStamp)

Retrieves the azimuth (QuantityType<Angle>) of the sun at the requested instant.
Thing method applies to Sun and Moon.

* `timeStamp` (ZonedDateTime) - defaulted to now() if null.

Example :

```
val azimuth = sunActions.getAzimuth(sunEventTime)
val elevation = sunActions.getElevation(sunEventTime)
logInfo("AstroActions", "{} will be positioned at elevation {} - azimuth {}",sunEvent, elevation.toString,azimuth.toString)
```


## Tips

Do not worry if for example the "astro dawn" is undefined at your location.
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.astro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.7-SNAPSHOT</version>
<version>2.5.8-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.astro</artifactId>
Expand Down
Loading