Skip to content

Commit

Permalink
Add Support for AWS MQTT based IAqualink devices, such as Zodiac Hydr…
Browse files Browse the repository at this point in the history
…oxinator

Signed-off-by: Jonathan Gilbert <[email protected]>
  • Loading branch information
jpg0 committed Oct 30, 2024
1 parent b36877e commit f91ecad
Show file tree
Hide file tree
Showing 27 changed files with 2,394 additions and 32 deletions.
51 changes: 46 additions & 5 deletions bundles/org.openhab.binding.iaqualink/pom.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,58 @@
<?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 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.iaqualink</artifactId>

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

<properties>
<bnd.importpackage>!org.graalvm.nativeimage.hosted;!org.apache.tapestry5.json.*,!org.codehaus.jettison.json.*,!org.json.*,!com.fasterxml.jackson.*,!jakarta.json.*</bnd.importpackage>
</properties>
<dependencies>
<dependency>
<groupId>software.amazon.awssdk.iotdevicesdk</groupId>
<artifactId>aws-iot-device-sdk</artifactId>
<version>1.21.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>software.amazon.awssdk.crt</groupId>
<artifactId>aws-crt</artifactId>
<version>0.31.3</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.9.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>accessors-smart</artifactId>
<version>2.5.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.5.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ public class IAqualinkBindingConstants {

public static final String CHANNEL_TYPE_ONETOUCH = "onetouch";

public static final String CHANNEL_TYPE_SCHEDULE_TIME = "schedule-time";

public static final ThingTypeUID IAQUALINK_DEVICE_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "controller");
public static final ThingTypeUID IAQUALINK_DEVICE_V2_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "controllerV2");

public static final ChannelTypeUID CHANNEL_TYPE_UID_ONETOUCH = new ChannelTypeUID(BINDING_ID,
CHANNEL_TYPE_ONETOUCH);
Expand All @@ -54,4 +57,6 @@ public class IAqualinkBindingConstants {
CHANNEL_TYPE_AUX_PENTAIRIB);
public static final ChannelTypeUID CHANNEL_TYPE_UID_AUX_HAYWARD = new ChannelTypeUID(BINDING_ID,
CHANNEL_TYPE_AUX_HAYWARD);
public static final ChannelTypeUID CHANNEL_TYPE_UID_SCHEDULE_TIME = new ChannelTypeUID(BINDING_ID,
CHANNEL_TYPE_SCHEDULE_TIME);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
package org.openhab.binding.iaqualink.internal;

import static org.openhab.binding.iaqualink.internal.IAqualinkBindingConstants.IAQUALINK_DEVICE_THING_TYPE_UID;
import static org.openhab.binding.iaqualink.internal.IAqualinkBindingConstants.IAQUALINK_DEVICE_V2_THING_TYPE_UID;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jetty.client.HttpClient;
import org.openhab.binding.iaqualink.internal.handler.IAqualinkHandler;
import org.openhab.binding.iaqualink.internal.v1.handler.IAqualinkHandler;
import org.openhab.binding.iaqualink.internal.v2.IAqualinkV2Handler;
import org.openhab.core.io.net.http.HttpClientFactory;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingTypeUID;
Expand Down Expand Up @@ -47,14 +49,17 @@ public IAqualinkHandlerFactory(@Reference final HttpClientFactory httpClientFact

@Override
public boolean supportsThingType(ThingTypeUID thingTypeUID) {
return IAQUALINK_DEVICE_THING_TYPE_UID.equals(thingTypeUID);
return IAQUALINK_DEVICE_THING_TYPE_UID.equals(thingTypeUID)
|| IAQUALINK_DEVICE_V2_THING_TYPE_UID.equals(thingTypeUID);
}

@Override
protected @Nullable ThingHandler createHandler(Thing thing) {
ThingTypeUID thingTypeUID = thing.getThingTypeUID();
if (IAQUALINK_DEVICE_THING_TYPE_UID.equals(thingTypeUID)) {
return new IAqualinkHandler(thing, httpClient);
} else if (IAQUALINK_DEVICE_V2_THING_TYPE_UID.equals(thingTypeUID)) {
return new IAqualinkV2Handler(thing, httpClient);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.iaqualink.internal.api;
package org.openhab.binding.iaqualink.internal.v1.api;

import java.io.IOException;
import java.lang.reflect.Type;
Expand All @@ -31,12 +31,12 @@
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.http.HttpStatus;
import org.openhab.binding.iaqualink.internal.api.dto.AccountInfo;
import org.openhab.binding.iaqualink.internal.api.dto.Auxiliary;
import org.openhab.binding.iaqualink.internal.api.dto.Device;
import org.openhab.binding.iaqualink.internal.api.dto.Home;
import org.openhab.binding.iaqualink.internal.api.dto.OneTouch;
import org.openhab.binding.iaqualink.internal.api.dto.SignIn;
import org.openhab.binding.iaqualink.internal.v1.api.dto.AccountInfo;
import org.openhab.binding.iaqualink.internal.v1.api.dto.Auxiliary;
import org.openhab.binding.iaqualink.internal.v1.api.dto.Device;
import org.openhab.binding.iaqualink.internal.v1.api.dto.Home;
import org.openhab.binding.iaqualink.internal.v1.api.dto.OneTouch;
import org.openhab.binding.iaqualink.internal.v1.api.dto.SignIn;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -343,7 +343,7 @@ private UriBuilder baseURI() {
/**
*
* @param <T>
* @param url
* @param uri
* @param typeOfT
* @return
* @throws IOException
Expand All @@ -355,7 +355,7 @@ private <T> T getAqualinkObject(URI uri, Type typeOfT) throws IOException, NotAu

/**
*
* @param url
* @param uri
* @return
* @throws IOException
* @throws NotAuthorizedException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.iaqualink.internal.api.dto;
package org.openhab.binding.iaqualink.internal.v1.api.dto;

/**
* Account Info Object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.iaqualink.internal.api.dto;
package org.openhab.binding.iaqualink.internal.v1.api.dto;

/**
* Auxiliary devices.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.iaqualink.internal.api.dto;
package org.openhab.binding.iaqualink.internal.v1.api.dto;

/**
* Device refers to an iAqualink Pool Controller.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.iaqualink.internal.api.dto;
package org.openhab.binding.iaqualink.internal.v1.api.dto;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.iaqualink.internal.api.dto;
package org.openhab.binding.iaqualink.internal.v1.api.dto;

/**
* OneTouch Macros.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.iaqualink.internal.api.dto;
package org.openhab.binding.iaqualink.internal.v1.api.dto;

/**
* Object used to login to service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.iaqualink.internal.handler;
package org.openhab.binding.iaqualink.internal.v1.handler;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.iaqualink.internal.handler;
package org.openhab.binding.iaqualink.internal.v1.handler;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.iaqualink.internal.handler;
package org.openhab.binding.iaqualink.internal.v1.handler;

import static org.openhab.core.library.unit.ImperialUnits.FAHRENHEIT;
import static org.openhab.core.library.unit.SIUnits.CELSIUS;
Expand All @@ -36,14 +36,14 @@
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jetty.client.HttpClient;
import org.openhab.binding.iaqualink.internal.IAqualinkBindingConstants;
import org.openhab.binding.iaqualink.internal.api.IAqualinkClient;
import org.openhab.binding.iaqualink.internal.api.IAqualinkClient.NotAuthorizedException;
import org.openhab.binding.iaqualink.internal.api.dto.AccountInfo;
import org.openhab.binding.iaqualink.internal.api.dto.Auxiliary;
import org.openhab.binding.iaqualink.internal.api.dto.Device;
import org.openhab.binding.iaqualink.internal.api.dto.Home;
import org.openhab.binding.iaqualink.internal.api.dto.OneTouch;
import org.openhab.binding.iaqualink.internal.config.IAqualinkConfiguration;
import org.openhab.binding.iaqualink.internal.v1.api.IAqualinkClient;
import org.openhab.binding.iaqualink.internal.v1.api.IAqualinkClient.NotAuthorizedException;
import org.openhab.binding.iaqualink.internal.v1.api.dto.AccountInfo;
import org.openhab.binding.iaqualink.internal.v1.api.dto.Auxiliary;
import org.openhab.binding.iaqualink.internal.v1.api.dto.Device;
import org.openhab.binding.iaqualink.internal.v1.api.dto.Home;
import org.openhab.binding.iaqualink.internal.v1.api.dto.OneTouch;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.library.types.OnOffType;
import org.openhab.core.library.types.PercentType;
Expand Down
Loading

0 comments on commit f91ecad

Please sign in to comment.