]> git.basschouten.com Git - openhab-addons.git/commitdiff
[iaqualink] Fixes critical login issue due to changed auth URLs. Moves 'model' packag...
authorDan Cunningham <dan@digitaldan.com>
Sat, 12 Jun 2021 11:39:17 +0000 (04:39 -0700)
committerGitHub <noreply@github.com>
Sat, 12 Jun 2021 11:39:17 +0000 (13:39 +0200)
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
15 files changed:
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/IAqualinkClient.java
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/AccountInfo.java [new file with mode: 0644]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/Auxiliary.java [new file with mode: 0644]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/Device.java [new file with mode: 0644]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/Home.java [new file with mode: 0644]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/OneTouch.java [new file with mode: 0644]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/SignIn.java [new file with mode: 0644]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/AccountInfo.java [deleted file]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Auxiliary.java [deleted file]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Device.java [deleted file]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Home.java [deleted file]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/OneTouch.java [deleted file]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/SignIn.java [deleted file]
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/config/IAqualinkConfiguration.java
bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/IAqualinkHandler.java

index 53c36c0b031451e434837903e68158f5e129f6c6..5f6a4f5f663ad2e6e32f6ee06312eca182fe505a 100644 (file)
@@ -31,12 +31,12 @@ import org.eclipse.jetty.client.util.StringContentProvider;
 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.model.AccountInfo;
-import org.openhab.binding.iaqualink.internal.api.model.Auxiliary;
-import org.openhab.binding.iaqualink.internal.api.model.Device;
-import org.openhab.binding.iaqualink.internal.api.model.Home;
-import org.openhab.binding.iaqualink.internal.api.model.OneTouch;
-import org.openhab.binding.iaqualink.internal.api.model.SignIn;
+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.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -73,7 +73,8 @@ public class IAqualinkClient {
     private static final String HEADER_ACCEPT_LANGUAGE = "en-us";
     private static final String HEADER_ACCEPT_ENCODING = "br, gzip, deflate";
 
-    private static final String SUPPORT_URL = "https://support.iaqualink.com";
+    private static final String AUTH_URL = "https://prod.zodiac-io.com/users/v1/login";
+    private static final String DEVICES_URL = "https://r-api.iaqualink.net/devices.json";
     private static final String IAQUALINK_BASE_URL = "https://p-api.iaqualink.net/v1/mobile/session.json";
 
     private Gson gson = new GsonBuilder().registerTypeAdapter(Home.class, new HomeDeserializer())
@@ -113,8 +114,8 @@ public class IAqualinkClient {
             throws IOException, NotAuthorizedException {
         String signIn = gson.toJson(new SignIn(apiKey, username, password)).toString();
         try {
-            ContentResponse response = httpClient.newRequest(SUPPORT_URL + "/users/sign_in.json")
-                    .method(HttpMethod.POST).content(new StringContentProvider(signIn), "application/json").send();
+            ContentResponse response = httpClient.newRequest(AUTH_URL).method(HttpMethod.POST)
+                    .content(new StringContentProvider(signIn), "application/json").send();
             if (response.getStatus() == HttpStatus.UNAUTHORIZED_401) {
                 throw new NotAuthorizedException(response.getReason());
             }
@@ -139,7 +140,7 @@ public class IAqualinkClient {
      */
     public Device[] getDevices(@Nullable String apiKey, @Nullable String token, int id)
             throws IOException, NotAuthorizedException {
-        return getAqualinkObject(UriBuilder.fromUri(SUPPORT_URL + "/devices.json"). //
+        return getAqualinkObject(UriBuilder.fromUri(DEVICES_URL). //
                 queryParam("api_key", apiKey). //
                 queryParam("authentication_token", token). //
                 queryParam("user_id", id).build(), Device[].class);
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/AccountInfo.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/AccountInfo.java
new file mode 100644 (file)
index 0000000..abb627a
--- /dev/null
@@ -0,0 +1,212 @@
+/**
+ * Copyright (c) 2010-2021 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.iaqualink.internal.api.dto;
+
+/**
+ * Account Info Object
+ *
+ * @author Dan Cunningham - Initial contribution
+ *
+ */
+public class AccountInfo {
+
+    private Integer id;
+
+    private String email;
+
+    private String createdAt;
+
+    private String updatedAt;
+
+    private Object timeZone;
+
+    private String firstName;
+
+    private String lastName;
+
+    private String address1;
+
+    private String address2;
+
+    private String city;
+
+    private String state;
+
+    private String postalCode;
+
+    private String country;
+
+    private String phone;
+
+    private Boolean optIn1;
+
+    private Boolean optIn2;
+
+    private String authenticationToken;
+
+    private String role;
+
+    private String sessionId;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getCreatedAt() {
+        return createdAt;
+    }
+
+    public void setCreatedAt(String createdAt) {
+        this.createdAt = createdAt;
+    }
+
+    public String getUpdatedAt() {
+        return updatedAt;
+    }
+
+    public void setUpdatedAt(String updatedAt) {
+        this.updatedAt = updatedAt;
+    }
+
+    public Object getTimeZone() {
+        return timeZone;
+    }
+
+    public void setTimeZone(Object timeZone) {
+        this.timeZone = timeZone;
+    }
+
+    public String getFirstName() {
+        return firstName;
+    }
+
+    public void setFirstName(String firstName) {
+        this.firstName = firstName;
+    }
+
+    public String getLastName() {
+        return lastName;
+    }
+
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+
+    public String getAddress1() {
+        return address1;
+    }
+
+    public void setAddress1(String address1) {
+        this.address1 = address1;
+    }
+
+    public String getAddress2() {
+        return address2;
+    }
+
+    public void setAddress2(String address2) {
+        this.address2 = address2;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getPostalCode() {
+        return postalCode;
+    }
+
+    public void setPostalCode(String postalCode) {
+        this.postalCode = postalCode;
+    }
+
+    public String getCountry() {
+        return country;
+    }
+
+    public void setCountry(String country) {
+        this.country = country;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public Boolean getOptIn1() {
+        return optIn1;
+    }
+
+    public void setOptIn1(Boolean optIn1) {
+        this.optIn1 = optIn1;
+    }
+
+    public Boolean getOptIn2() {
+        return optIn2;
+    }
+
+    public void setOptIn2(Boolean optIn2) {
+        this.optIn2 = optIn2;
+    }
+
+    public String getAuthenticationToken() {
+        return authenticationToken;
+    }
+
+    public void setAuthenticationToken(String authenticationToken) {
+        this.authenticationToken = authenticationToken;
+    }
+
+    public String getRole() {
+        return role;
+    }
+
+    public void setRole(String role) {
+        this.role = role;
+    }
+
+    public String getSessionId() {
+        return sessionId;
+    }
+
+    public void setSessionId(String sessionId) {
+        this.sessionId = sessionId;
+    }
+}
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/Auxiliary.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/Auxiliary.java
new file mode 100644 (file)
index 0000000..2ac0373
--- /dev/null
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2010-2021 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.iaqualink.internal.api.dto;
+
+/**
+ * Auxiliary devices.
+ *
+ * @author Dan Cunningham - Initial contribution
+ *
+ */
+public class Auxiliary {
+
+    private String state;
+
+    private String label;
+
+    private String icon;
+
+    private String type;
+
+    private String subtype;
+
+    private String name;
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+    public void setLabel(String label) {
+        this.label = label;
+    }
+
+    public String getIcon() {
+        return icon;
+    }
+
+    public void setIcon(String icon) {
+        this.icon = icon;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getSubtype() {
+        return subtype;
+    }
+
+    public void setSubtype(String subtype) {
+        this.subtype = subtype;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/Device.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/Device.java
new file mode 100644 (file)
index 0000000..594c4fd
--- /dev/null
@@ -0,0 +1,142 @@
+/**
+ * Copyright (c) 2010-2021 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.iaqualink.internal.api.dto;
+
+/**
+ * Device refers to a iAqualink Pool Controller.
+ *
+ * @author Dan Cunningham - Initial contribution
+ *
+ */
+public class Device {
+
+    private Integer id;
+
+    private String serialNumber;
+
+    private String createdAt;
+
+    private String updatedAt;
+
+    private String name;
+
+    private String deviceType;
+
+    private Object ownerId;
+
+    private Boolean updating;
+
+    private Object firmwareVersion;
+
+    private Object targetFirmwareVersion;
+
+    private Object updateFirmwareStartAt;
+
+    private Object lastActivityAt;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getSerialNumber() {
+        return serialNumber;
+    }
+
+    public void setSerialNumber(String serialNumber) {
+        this.serialNumber = serialNumber;
+    }
+
+    public String getCreatedAt() {
+        return createdAt;
+    }
+
+    public void setCreatedAt(String createdAt) {
+        this.createdAt = createdAt;
+    }
+
+    public String getUpdatedAt() {
+        return updatedAt;
+    }
+
+    public void setUpdatedAt(String updatedAt) {
+        this.updatedAt = updatedAt;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDeviceType() {
+        return deviceType;
+    }
+
+    public void setDeviceType(String deviceType) {
+        this.deviceType = deviceType;
+    }
+
+    public Object getOwnerId() {
+        return ownerId;
+    }
+
+    public void setOwnerId(Object ownerId) {
+        this.ownerId = ownerId;
+    }
+
+    public Boolean getUpdating() {
+        return updating;
+    }
+
+    public void setUpdating(Boolean updating) {
+        this.updating = updating;
+    }
+
+    public Object getFirmwareVersion() {
+        return firmwareVersion;
+    }
+
+    public void setFirmwareVersion(Object firmwareVersion) {
+        this.firmwareVersion = firmwareVersion;
+    }
+
+    public Object getTargetFirmwareVersion() {
+        return targetFirmwareVersion;
+    }
+
+    public void setTargetFirmwareVersion(Object targetFirmwareVersion) {
+        this.targetFirmwareVersion = targetFirmwareVersion;
+    }
+
+    public Object getUpdateFirmwareStartAt() {
+        return updateFirmwareStartAt;
+    }
+
+    public void setUpdateFirmwareStartAt(Object updateFirmwareStartAt) {
+        this.updateFirmwareStartAt = updateFirmwareStartAt;
+    }
+
+    public Object getLastActivityAt() {
+        return lastActivityAt;
+    }
+
+    public void setLastActivityAt(Object lastActivityAt) {
+        this.lastActivityAt = lastActivityAt;
+    }
+}
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/Home.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/Home.java
new file mode 100644 (file)
index 0000000..fad89b1
--- /dev/null
@@ -0,0 +1,230 @@
+/**
+ * Copyright (c) 2010-2021 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.iaqualink.internal.api.dto;
+
+import java.util.Map;
+
+/**
+ * {@link Home} refers to the "Home" screen of a pool controller.
+ *
+ * @author Dan Cunningham - Initial contribution
+ *
+ */
+public class Home {
+
+    private String status;
+
+    private String response;
+
+    private String systemType;
+
+    private String tempScale;
+
+    private String spaTemp;
+
+    private String poolTemp;
+
+    private String airTemp;
+
+    private String spaSetPoint;
+
+    private String poolSetPoint;
+
+    private String coverPool;
+
+    private String freezeProtection;
+
+    private String spaPump;
+
+    private String poolPump;
+
+    private String spaHeater;
+
+    private String poolHeater;
+
+    private String solarHeater;
+
+    private String spaSalinity;
+
+    private String poolSalinity;
+
+    private String orp;
+
+    private String ph;
+
+    private Map<String, String> serializedMap;
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getResponse() {
+        return response;
+    }
+
+    public void setResponse(String response) {
+        this.response = response;
+    }
+
+    public String getSystemType() {
+        return systemType;
+    }
+
+    public void setSystemType(String systemType) {
+        this.systemType = systemType;
+    }
+
+    public String getTempScale() {
+        return tempScale;
+    }
+
+    public void setTempScale(String tempScale) {
+        this.tempScale = tempScale;
+    }
+
+    public String getSpaTemp() {
+        return spaTemp;
+    }
+
+    public void setSpaTemp(String spaTemp) {
+        this.spaTemp = spaTemp;
+    }
+
+    public String getPoolTemp() {
+        return poolTemp;
+    }
+
+    public void setPoolTemp(String poolTemp) {
+        this.poolTemp = poolTemp;
+    }
+
+    public String getAirTemp() {
+        return airTemp;
+    }
+
+    public void setAirTemp(String airTemp) {
+        this.airTemp = airTemp;
+    }
+
+    public String getSpaSetPoint() {
+        return spaSetPoint;
+    }
+
+    public void setSpaSetPoint(String spaSetPoint) {
+        this.spaSetPoint = spaSetPoint;
+    }
+
+    public String getPoolSetPoint() {
+        return poolSetPoint;
+    }
+
+    public void setPoolSetPoint(String poolSetPoint) {
+        this.poolSetPoint = poolSetPoint;
+    }
+
+    public String getCoverPool() {
+        return coverPool;
+    }
+
+    public void setCoverPool(String coverPool) {
+        this.coverPool = coverPool;
+    }
+
+    public String getFreezeProtection() {
+        return freezeProtection;
+    }
+
+    public void setFreezeProtection(String freezeProtection) {
+        this.freezeProtection = freezeProtection;
+    }
+
+    public String getSpaPump() {
+        return spaPump;
+    }
+
+    public void setSpaPump(String spaPump) {
+        this.spaPump = spaPump;
+    }
+
+    public String getPoolPump() {
+        return poolPump;
+    }
+
+    public void setPoolPump(String poolPump) {
+        this.poolPump = poolPump;
+    }
+
+    public String getSpaHeater() {
+        return spaHeater;
+    }
+
+    public void setSpaHeater(String spaHeater) {
+        this.spaHeater = spaHeater;
+    }
+
+    public String getPoolHeater() {
+        return poolHeater;
+    }
+
+    public void setPoolHeater(String poolHeater) {
+        this.poolHeater = poolHeater;
+    }
+
+    public String getSolarHeater() {
+        return solarHeater;
+    }
+
+    public void setSolarHeater(String solarHeater) {
+        this.solarHeater = solarHeater;
+    }
+
+    public String getSpaSalinity() {
+        return spaSalinity;
+    }
+
+    public void setSpaSalinity(String spaSalinity) {
+        this.spaSalinity = spaSalinity;
+    }
+
+    public String getPoolSalinity() {
+        return poolSalinity;
+    }
+
+    public void setPoolSalinity(String poolSalinity) {
+        this.poolSalinity = poolSalinity;
+    }
+
+    public String getOrp() {
+        return orp;
+    }
+
+    public void setOrp(String orp) {
+        this.orp = orp;
+    }
+
+    public String getPh() {
+        return ph;
+    }
+
+    public void setPh(String ph) {
+        this.ph = ph;
+    }
+
+    public Map<String, String> getSerializedMap() {
+        return serializedMap;
+    }
+}
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/OneTouch.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/OneTouch.java
new file mode 100644 (file)
index 0000000..5c9eeb5
--- /dev/null
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2010-2021 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.iaqualink.internal.api.dto;
+
+/**
+ * OneTouch Macros.
+ *
+ * @author Dan Cunningham - Initial contribution
+ *
+ */
+public class OneTouch {
+
+    private String status;
+
+    private String state;
+
+    private String label;
+
+    private String name;
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+    public void setLabel(String label) {
+        this.label = label;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/SignIn.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/dto/SignIn.java
new file mode 100644 (file)
index 0000000..c6ca285
--- /dev/null
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2010-2021 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.iaqualink.internal.api.dto;
+
+/**
+ * Object used to login to service.
+ *
+ * @author Dan Cunningham - Initial contribution
+ *
+ */
+public class SignIn {
+
+    private String apiKey;
+
+    private String email;
+
+    private String password;
+
+    public SignIn(String apiKey, String email, String password) {
+        super();
+        this.apiKey = apiKey;
+        this.email = email;
+        this.password = password;
+    }
+
+    public String getApiKey() {
+        return apiKey;
+    }
+
+    public void setApiKey(String apiKey) {
+        this.apiKey = apiKey;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+}
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/AccountInfo.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/AccountInfo.java
deleted file mode 100644 (file)
index 9345242..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/**
- * Copyright (c) 2010-2021 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.iaqualink.internal.api.model;
-
-/**
- * Account Info Object
- *
- * @author Dan Cunningham - Initial contribution
- *
- */
-public class AccountInfo {
-
-    private Integer id;
-
-    private String email;
-
-    private String createdAt;
-
-    private String updatedAt;
-
-    private Object timeZone;
-
-    private String firstName;
-
-    private String lastName;
-
-    private String address1;
-
-    private String address2;
-
-    private String city;
-
-    private String state;
-
-    private String postalCode;
-
-    private String country;
-
-    private String phone;
-
-    private Boolean optIn1;
-
-    private Boolean optIn2;
-
-    private String authenticationToken;
-
-    private String role;
-
-    private String sessionId;
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getEmail() {
-        return email;
-    }
-
-    public void setEmail(String email) {
-        this.email = email;
-    }
-
-    public String getCreatedAt() {
-        return createdAt;
-    }
-
-    public void setCreatedAt(String createdAt) {
-        this.createdAt = createdAt;
-    }
-
-    public String getUpdatedAt() {
-        return updatedAt;
-    }
-
-    public void setUpdatedAt(String updatedAt) {
-        this.updatedAt = updatedAt;
-    }
-
-    public Object getTimeZone() {
-        return timeZone;
-    }
-
-    public void setTimeZone(Object timeZone) {
-        this.timeZone = timeZone;
-    }
-
-    public String getFirstName() {
-        return firstName;
-    }
-
-    public void setFirstName(String firstName) {
-        this.firstName = firstName;
-    }
-
-    public String getLastName() {
-        return lastName;
-    }
-
-    public void setLastName(String lastName) {
-        this.lastName = lastName;
-    }
-
-    public String getAddress1() {
-        return address1;
-    }
-
-    public void setAddress1(String address1) {
-        this.address1 = address1;
-    }
-
-    public String getAddress2() {
-        return address2;
-    }
-
-    public void setAddress2(String address2) {
-        this.address2 = address2;
-    }
-
-    public String getCity() {
-        return city;
-    }
-
-    public void setCity(String city) {
-        this.city = city;
-    }
-
-    public String getState() {
-        return state;
-    }
-
-    public void setState(String state) {
-        this.state = state;
-    }
-
-    public String getPostalCode() {
-        return postalCode;
-    }
-
-    public void setPostalCode(String postalCode) {
-        this.postalCode = postalCode;
-    }
-
-    public String getCountry() {
-        return country;
-    }
-
-    public void setCountry(String country) {
-        this.country = country;
-    }
-
-    public String getPhone() {
-        return phone;
-    }
-
-    public void setPhone(String phone) {
-        this.phone = phone;
-    }
-
-    public Boolean getOptIn1() {
-        return optIn1;
-    }
-
-    public void setOptIn1(Boolean optIn1) {
-        this.optIn1 = optIn1;
-    }
-
-    public Boolean getOptIn2() {
-        return optIn2;
-    }
-
-    public void setOptIn2(Boolean optIn2) {
-        this.optIn2 = optIn2;
-    }
-
-    public String getAuthenticationToken() {
-        return authenticationToken;
-    }
-
-    public void setAuthenticationToken(String authenticationToken) {
-        this.authenticationToken = authenticationToken;
-    }
-
-    public String getRole() {
-        return role;
-    }
-
-    public void setRole(String role) {
-        this.role = role;
-    }
-
-    public String getSessionId() {
-        return sessionId;
-    }
-
-    public void setSessionId(String sessionId) {
-        this.sessionId = sessionId;
-    }
-}
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Auxiliary.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Auxiliary.java
deleted file mode 100644 (file)
index aa29a1d..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Copyright (c) 2010-2021 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.iaqualink.internal.api.model;
-
-/**
- * Auxiliary devices.
- *
- * @author Dan Cunningham - Initial contribution
- *
- */
-public class Auxiliary {
-
-    private String state;
-
-    private String label;
-
-    private String icon;
-
-    private String type;
-
-    private String subtype;
-
-    private String name;
-
-    public String getState() {
-        return state;
-    }
-
-    public void setState(String state) {
-        this.state = state;
-    }
-
-    public String getLabel() {
-        return label;
-    }
-
-    public void setLabel(String label) {
-        this.label = label;
-    }
-
-    public String getIcon() {
-        return icon;
-    }
-
-    public void setIcon(String icon) {
-        this.icon = icon;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String getSubtype() {
-        return subtype;
-    }
-
-    public void setSubtype(String subtype) {
-        this.subtype = subtype;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Device.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Device.java
deleted file mode 100644 (file)
index f253c65..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/**
- * Copyright (c) 2010-2021 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.iaqualink.internal.api.model;
-
-/**
- * Device refers to a iAqualink Pool Controller.
- *
- * @author Dan Cunningham - Initial contribution
- *
- */
-public class Device {
-
-    private Integer id;
-
-    private String serialNumber;
-
-    private String createdAt;
-
-    private String updatedAt;
-
-    private String name;
-
-    private String deviceType;
-
-    private Object ownerId;
-
-    private Boolean updating;
-
-    private Object firmwareVersion;
-
-    private Object targetFirmwareVersion;
-
-    private Object updateFirmwareStartAt;
-
-    private Object lastActivityAt;
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getSerialNumber() {
-        return serialNumber;
-    }
-
-    public void setSerialNumber(String serialNumber) {
-        this.serialNumber = serialNumber;
-    }
-
-    public String getCreatedAt() {
-        return createdAt;
-    }
-
-    public void setCreatedAt(String createdAt) {
-        this.createdAt = createdAt;
-    }
-
-    public String getUpdatedAt() {
-        return updatedAt;
-    }
-
-    public void setUpdatedAt(String updatedAt) {
-        this.updatedAt = updatedAt;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getDeviceType() {
-        return deviceType;
-    }
-
-    public void setDeviceType(String deviceType) {
-        this.deviceType = deviceType;
-    }
-
-    public Object getOwnerId() {
-        return ownerId;
-    }
-
-    public void setOwnerId(Object ownerId) {
-        this.ownerId = ownerId;
-    }
-
-    public Boolean getUpdating() {
-        return updating;
-    }
-
-    public void setUpdating(Boolean updating) {
-        this.updating = updating;
-    }
-
-    public Object getFirmwareVersion() {
-        return firmwareVersion;
-    }
-
-    public void setFirmwareVersion(Object firmwareVersion) {
-        this.firmwareVersion = firmwareVersion;
-    }
-
-    public Object getTargetFirmwareVersion() {
-        return targetFirmwareVersion;
-    }
-
-    public void setTargetFirmwareVersion(Object targetFirmwareVersion) {
-        this.targetFirmwareVersion = targetFirmwareVersion;
-    }
-
-    public Object getUpdateFirmwareStartAt() {
-        return updateFirmwareStartAt;
-    }
-
-    public void setUpdateFirmwareStartAt(Object updateFirmwareStartAt) {
-        this.updateFirmwareStartAt = updateFirmwareStartAt;
-    }
-
-    public Object getLastActivityAt() {
-        return lastActivityAt;
-    }
-
-    public void setLastActivityAt(Object lastActivityAt) {
-        this.lastActivityAt = lastActivityAt;
-    }
-}
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Home.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Home.java
deleted file mode 100644 (file)
index a66fba2..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/**
- * Copyright (c) 2010-2021 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.iaqualink.internal.api.model;
-
-import java.util.Map;
-
-/**
- * {@link Home} refers to the "Home" screen of a pool controller.
- *
- * @author Dan Cunningham - Initial contribution
- *
- */
-public class Home {
-
-    private String status;
-
-    private String response;
-
-    private String systemType;
-
-    private String tempScale;
-
-    private String spaTemp;
-
-    private String poolTemp;
-
-    private String airTemp;
-
-    private String spaSetPoint;
-
-    private String poolSetPoint;
-
-    private String coverPool;
-
-    private String freezeProtection;
-
-    private String spaPump;
-
-    private String poolPump;
-
-    private String spaHeater;
-
-    private String poolHeater;
-
-    private String solarHeater;
-
-    private String spaSalinity;
-
-    private String poolSalinity;
-
-    private String orp;
-
-    private String ph;
-
-    private Map<String, String> serializedMap;
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public String getResponse() {
-        return response;
-    }
-
-    public void setResponse(String response) {
-        this.response = response;
-    }
-
-    public String getSystemType() {
-        return systemType;
-    }
-
-    public void setSystemType(String systemType) {
-        this.systemType = systemType;
-    }
-
-    public String getTempScale() {
-        return tempScale;
-    }
-
-    public void setTempScale(String tempScale) {
-        this.tempScale = tempScale;
-    }
-
-    public String getSpaTemp() {
-        return spaTemp;
-    }
-
-    public void setSpaTemp(String spaTemp) {
-        this.spaTemp = spaTemp;
-    }
-
-    public String getPoolTemp() {
-        return poolTemp;
-    }
-
-    public void setPoolTemp(String poolTemp) {
-        this.poolTemp = poolTemp;
-    }
-
-    public String getAirTemp() {
-        return airTemp;
-    }
-
-    public void setAirTemp(String airTemp) {
-        this.airTemp = airTemp;
-    }
-
-    public String getSpaSetPoint() {
-        return spaSetPoint;
-    }
-
-    public void setSpaSetPoint(String spaSetPoint) {
-        this.spaSetPoint = spaSetPoint;
-    }
-
-    public String getPoolSetPoint() {
-        return poolSetPoint;
-    }
-
-    public void setPoolSetPoint(String poolSetPoint) {
-        this.poolSetPoint = poolSetPoint;
-    }
-
-    public String getCoverPool() {
-        return coverPool;
-    }
-
-    public void setCoverPool(String coverPool) {
-        this.coverPool = coverPool;
-    }
-
-    public String getFreezeProtection() {
-        return freezeProtection;
-    }
-
-    public void setFreezeProtection(String freezeProtection) {
-        this.freezeProtection = freezeProtection;
-    }
-
-    public String getSpaPump() {
-        return spaPump;
-    }
-
-    public void setSpaPump(String spaPump) {
-        this.spaPump = spaPump;
-    }
-
-    public String getPoolPump() {
-        return poolPump;
-    }
-
-    public void setPoolPump(String poolPump) {
-        this.poolPump = poolPump;
-    }
-
-    public String getSpaHeater() {
-        return spaHeater;
-    }
-
-    public void setSpaHeater(String spaHeater) {
-        this.spaHeater = spaHeater;
-    }
-
-    public String getPoolHeater() {
-        return poolHeater;
-    }
-
-    public void setPoolHeater(String poolHeater) {
-        this.poolHeater = poolHeater;
-    }
-
-    public String getSolarHeater() {
-        return solarHeater;
-    }
-
-    public void setSolarHeater(String solarHeater) {
-        this.solarHeater = solarHeater;
-    }
-
-    public String getSpaSalinity() {
-        return spaSalinity;
-    }
-
-    public void setSpaSalinity(String spaSalinity) {
-        this.spaSalinity = spaSalinity;
-    }
-
-    public String getPoolSalinity() {
-        return poolSalinity;
-    }
-
-    public void setPoolSalinity(String poolSalinity) {
-        this.poolSalinity = poolSalinity;
-    }
-
-    public String getOrp() {
-        return orp;
-    }
-
-    public void setOrp(String orp) {
-        this.orp = orp;
-    }
-
-    public String getPh() {
-        return ph;
-    }
-
-    public void setPh(String ph) {
-        this.ph = ph;
-    }
-
-    public Map<String, String> getSerializedMap() {
-        return serializedMap;
-    }
-}
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/OneTouch.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/OneTouch.java
deleted file mode 100644 (file)
index f28bcbd..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Copyright (c) 2010-2021 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.iaqualink.internal.api.model;
-
-/**
- * OneTouch Macros.
- *
- * @author Dan Cunningham - Initial contribution
- *
- */
-public class OneTouch {
-
-    private String status;
-
-    private String state;
-
-    private String label;
-
-    private String name;
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public String getState() {
-        return state;
-    }
-
-    public void setState(String state) {
-        this.state = state;
-    }
-
-    public String getLabel() {
-        return label;
-    }
-
-    public void setLabel(String label) {
-        this.label = label;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}
diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/SignIn.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/SignIn.java
deleted file mode 100644 (file)
index 29b6b75..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Copyright (c) 2010-2021 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.iaqualink.internal.api.model;
-
-/**
- * Object used to login to service.
- *
- * @author Dan Cunningham - Initial contribution
- *
- */
-public class SignIn {
-
-    private String apiKey;
-
-    private String email;
-
-    private String password;
-
-    public SignIn(String apiKey, String email, String password) {
-        super();
-        this.apiKey = apiKey;
-        this.email = email;
-        this.password = password;
-    }
-
-    public String getApiKey() {
-        return apiKey;
-    }
-
-    public void setApiKey(String apiKey) {
-        this.apiKey = apiKey;
-    }
-
-    public String getEmail() {
-        return email;
-    }
-
-    public void setEmail(String email) {
-        this.email = email;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-}
index b73bab60cbe1ab0b0fd003fffc2cce4568736895..16e530c358bc20e53214d917c6044f73057c54a5 100644 (file)
  */
 package org.openhab.binding.iaqualink.internal.config;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
 /**
  * Configuration properties for connecting to a iAqualink Account
  *
  * @author Dan Cunningham - Initial contribution
  *
  */
+@NonNullByDefault
 public class IAqualinkConfiguration {
 
     /**
      * user to us when connecting to the account
      */
-    public String userName;
+    public String userName = "";
 
     /**
      * password to us when connecting to the account
      */
-    public String password;
+    public String password = "";
 
     /**
      * Option serialId of the pool controller to connect to, only useful if you have more then one controller
      */
-    public String serialId;
+    public String serialId = "";
 
     /**
      * fixed API key provided by iAqualink clients (Android, IOS) , unknown if this will change in the future.
      */
-    public String apiKey;
+    public String apiKey = "";
 
     /**
      * Rate we poll for new data
      */
-    public int refresh;
+    public int refresh = 30;
 }
index 1387dcc7c2b8d8793d3e82d0b1a82976458baa9c..50a4e189bf465c578e75823345da3eb2f31bd7b5 100644 (file)
@@ -38,11 +38,11 @@ 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.model.AccountInfo;
-import org.openhab.binding.iaqualink.internal.api.model.Auxiliary;
-import org.openhab.binding.iaqualink.internal.api.model.Device;
-import org.openhab.binding.iaqualink.internal.api.model.Home;
-import org.openhab.binding.iaqualink.internal.api.model.OneTouch;
+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.core.library.types.DecimalType;
 import org.openhab.core.library.types.OnOffType;