Skip to content

Commit

Permalink
Merge pull request #56 from LukasA83/openhab3-dev
Browse files Browse the repository at this point in the history
[Landroid] Update to OH3 namespaces, dependencies etc.
  • Loading branch information
nibi79 authored Nov 24, 2020
2 parents 582143a + 6fcddb3 commit 7d858d7
Show file tree
Hide file tree
Showing 37 changed files with 180 additions and 211 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/doc/
/target/
/.settings/
/target/
/.settings/
Binary file removed lib/aws-iot-device-sdk-java-1.3.4.jar
Binary file not shown.
Binary file removed lib/org.eclipse.paho.client.mqttv3-1.2.2.jar
Binary file not shown.
62 changes: 36 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
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>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.3-SNAPSHOT</version>
</parent>
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>3.0.0-SNAPSHOT</version>
</parent>

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

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

<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-iot-device-sdk-java</artifactId>
<version>1.3.7</version>
</dependency>
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>1.2.5</version>
</dependency>
</dependencies>
</project>
20 changes: 10 additions & 10 deletions src/main/feature/feature.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.worxlandroid-${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>
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-binding-worxlandroid" description="WorxLandroid Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.worxlandroid/${project.version}</bundle>
<!--
<bundle>mvn:com.fasterxml.jackson.core/jackson-core/2.9.9</bundle>
<bundle>mvn:com.fasterxml.jackson.core/jackson-databind/2.9.9.3</bundle>
<bundle>mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.0</bundle>
-->
</feature>
<feature name="openhab-binding-worxlandroid" description="WorxLandroid Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.worxlandroid/${project.version}</bundle>
<!--
<bundle>mvn:com.fasterxml.jackson.core/jackson-core/2.9.9</bundle>
<bundle>mvn:com.fasterxml.jackson.core/jackson-databind/2.9.9.3</bundle>
<bundle>mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.0</bundle>
-->
</feature>
</features>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.Set;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.smarthome.core.thing.ThingTypeUID;
import org.openhab.core.thing.ThingTypeUID;

/**
* The {@link WorxLandroidBindingConstants} class defines datCommon constants, which are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.paho.client.mqttv3.MqttAsyncClient;
import org.eclipse.smarthome.core.thing.Bridge;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.eclipse.smarthome.core.thing.ThingStatus;
import org.eclipse.smarthome.core.thing.ThingStatusDetail;
import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler;
import org.eclipse.smarthome.core.types.Command;
import org.openhab.binding.worxlandroid.internal.config.BridgeConfiguration;
import org.openhab.binding.worxlandroid.internal.discovery.MowerDiscoveryService;
import org.openhab.binding.worxlandroid.internal.mqtt.AWSClient;
Expand All @@ -43,6 +37,12 @@
import org.openhab.binding.worxlandroid.internal.webapi.WorxLandroidWebApiImpl;
import org.openhab.binding.worxlandroid.internal.webapi.response.UsersCertificateResponse;
import org.openhab.binding.worxlandroid.internal.webapi.response.UsersMeResponse;
import org.openhab.core.thing.Bridge;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.ThingStatus;
import org.openhab.core.thing.ThingStatusDetail;
import org.openhab.core.thing.binding.BaseBridgeHandler;
import org.openhab.core.types.Command;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -157,7 +157,6 @@ public void initialize() {
logger.error("Iniialization error - toString: {}", e.toString());
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error: " + e.getMessage());
}

}

@Override
Expand Down Expand Up @@ -222,7 +221,6 @@ public void publishMessage(AWSMessage awsMessage) throws AWSIotException {
logger.debug("publish topic -> {}", awsMessage.getTopic());
logger.debug("publish message -> {}", awsMessage.getStringPayload());
awsClient.publish(awsMessage);

}

@Override
Expand All @@ -241,6 +239,5 @@ public void onAWSConnectionFailure() {
public void onAWSConnectionClosed() {
logger.debug("AWS connection closed");
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "AWS connection closed!");

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@

import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.smarthome.config.discovery.DiscoveryService;
import org.eclipse.smarthome.core.thing.Bridge;
import org.eclipse.smarthome.core.thing.Thing;
import org.eclipse.smarthome.core.thing.ThingTypeUID;
import org.eclipse.smarthome.core.thing.ThingUID;
import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory;
import org.eclipse.smarthome.core.thing.binding.ThingHandler;
import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory;
import org.eclipse.smarthome.io.net.http.HttpClientFactory;
import org.openhab.binding.worxlandroid.internal.discovery.MowerDiscoveryService;
import org.openhab.core.config.discovery.DiscoveryService;
import org.openhab.core.io.net.http.HttpClientFactory;
import org.openhab.core.thing.Bridge;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.ThingUID;
import org.openhab.core.thing.binding.BaseThingHandlerFactory;
import org.openhab.core.thing.binding.ThingHandler;
import org.openhab.core.thing.binding.ThingHandlerFactory;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,6 @@

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.smarthome.core.library.types.DateTimeType;
import org.eclipse.smarthome.core.library.types.DecimalType;
import org.eclipse.smarthome.core.library.types.OnOffType;
import org.eclipse.smarthome.core.library.types.StringType;
import org.eclipse.smarthome.core.thing.Bridge;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.eclipse.smarthome.core.thing.Thing;
import org.eclipse.smarthome.core.thing.ThingStatus;
import org.eclipse.smarthome.core.thing.ThingStatusDetail;
import org.eclipse.smarthome.core.thing.ThingStatusInfo;
import org.eclipse.smarthome.core.thing.binding.BaseThingHandler;
import org.eclipse.smarthome.core.thing.binding.ThingHandler;
import org.eclipse.smarthome.core.thing.binding.builder.ThingBuilder;
import org.eclipse.smarthome.core.types.Command;
import org.eclipse.smarthome.core.types.RefreshType;
import org.openhab.binding.worxlandroid.internal.codes.WorxLandroidActionCodes;
import org.openhab.binding.worxlandroid.internal.codes.WorxLandroidDayCodes;
import org.openhab.binding.worxlandroid.internal.codes.WorxLandroidErrorCodes;
Expand All @@ -55,6 +40,21 @@
import org.openhab.binding.worxlandroid.internal.webapi.WorxLandroidWebApiImpl;
import org.openhab.binding.worxlandroid.internal.webapi.response.ProductItemsResponse;
import org.openhab.binding.worxlandroid.internal.webapi.response.ProductItemsStatusResponse;
import org.openhab.core.library.types.DateTimeType;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.library.types.OnOffType;
import org.openhab.core.library.types.StringType;
import org.openhab.core.thing.Bridge;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingStatus;
import org.openhab.core.thing.ThingStatusDetail;
import org.openhab.core.thing.ThingStatusInfo;
import org.openhab.core.thing.binding.BaseThingHandler;
import org.openhab.core.thing.binding.ThingHandler;
import org.openhab.core.thing.binding.builder.ThingBuilder;
import org.openhab.core.types.Command;
import org.openhab.core.types.RefreshType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ public String getDescription() {
public String toString() {
return String.format("%s | ActionCode: %d - %s", this.name(), this.getCode(), this.getDescription());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ public String getDescription() {
public String toString() {
return String.format("%s | DayCode: %d - %s", this.name(), this.getCode(), this.getDescription());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService;
import org.eclipse.smarthome.config.discovery.DiscoveryResult;
import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder;
import org.eclipse.smarthome.core.thing.ThingStatus;
import org.eclipse.smarthome.core.thing.ThingTypeUID;
import org.eclipse.smarthome.core.thing.ThingUID;
import org.openhab.binding.worxlandroid.internal.WorxLandroidBindingConstants;
import org.openhab.binding.worxlandroid.internal.WorxLandroidBridgeHandler;
import org.openhab.binding.worxlandroid.internal.webapi.WorxLandroidWebApiImpl;
import org.openhab.binding.worxlandroid.internal.webapi.response.ProductItemsResponse;
import org.openhab.core.config.discovery.AbstractDiscoveryService;
import org.openhab.core.config.discovery.DiscoveryResult;
import org.openhab.core.config.discovery.DiscoveryResultBuilder;
import org.openhab.core.thing.ThingStatus;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.ThingUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -129,5 +129,4 @@ protected void startScan() {
protected void startBackgroundDiscovery() {
startScan();
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ public void onTimeout() {
// called when message publishing timed out
logger.warn("AWS message publishing timed out");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ public void onMessage(@Nullable AWSIotMessage message) {
logger.debug("onMessage: {}", message.getStringPayload());
callback.processMessage(message);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ public ScheduledDay getScheduledDay(WorxLandroidDayCodes dayCode) {

public void put(WorxLandroidDayCodes dayCode, ScheduledDay scheduledDay) {
scheduledDays.put(dayCode, scheduledDay);

}

/**
Expand All @@ -185,7 +184,6 @@ public ScheduledDay getScheduledDay2(WorxLandroidDayCodes dayCode) {

public void putScheduledDay2(WorxLandroidDayCodes dayCode, ScheduledDay scheduledDay) {
scheduledDays2.put(dayCode, scheduledDay);

}

/**
Expand Down Expand Up @@ -341,5 +339,4 @@ public long getStatus() {
public void setStatus(long status) {
this.status = status;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,4 @@ public int getErrorCode() {
public String getErrorMsg() {
return errorMsg;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,4 @@ public interface WorxLandroidApi {
* @throws WebApiException
*/
public ProductItemsStatusResponse retrieveDeviceStatus(String serialNumber) throws WebApiException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public boolean connect(String username, String password) {
logger.error("Error connecting to Worx Landroid WebApi! Error = {}", e.getErrorMsg());
return false;
}

}

@Override
Expand All @@ -77,7 +76,6 @@ public UsersCertificateResponse retrieveAwsCertificate() throws WebApiException

UsersCertificateRequest awsCertificateRequest = new UsersCertificateRequest(httpClient);
return awsCertificateRequest.call(apiAuth);

}

@Override
Expand All @@ -89,7 +87,6 @@ public UsersMeResponse retrieveWebInfo() throws WebApiException {

UsersMeRequest webInfoRequest = new UsersMeRequest(httpClient);
return webInfoRequest.call(apiAuth);

}

@Override
Expand All @@ -101,7 +98,6 @@ public ProductItemsResponse retrieveUserDevices() throws WebApiException {

ProductItemsRequest productItemsRequest = new ProductItemsRequest(httpClient);
return productItemsRequest.call(apiAuth);

}

@Override
Expand All @@ -113,7 +109,6 @@ public ProductItemsStatusResponse retrieveDeviceStatus(String serialNumber) thro

ProductItemsStatusRequest productItemsStatusRequest = new ProductItemsStatusRequest(httpClient);
return productItemsStatusRequest.call(apiAuth, serialNumber);

}

@Override
Expand All @@ -125,7 +120,5 @@ public ProductsResponse retrieveDevices() throws WebApiException {

ProductsRequest productsRequest = new ProductsRequest(httpClient);
return productsRequest.call(apiAuth);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,4 @@ public OauthTokenResponse call(String username, String password) throws WebApiEx

return callWebApi(request);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ public ProductItemsResponse call(WebApiAuth auth) throws WebApiException {

return callWebApiGet(APIURL_PRODUCTITEMS, auth);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ public ProductItemsStatusResponse call(WebApiAuth auth, String serialNumber) thr

return callWebApiGet(String.format("%s/%s/status", APIURL_PRODUCTITEMS, serialNumber), auth);
}

}
Loading

0 comments on commit 7d858d7

Please sign in to comment.