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;
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())
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());
}
*/
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);
--- /dev/null
+/**
+ * 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;
+ }
+}
--- /dev/null
+/**
+ * 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;
+ }
+}
--- /dev/null
+/**
+ * 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;
+ }
+}
--- /dev/null
+/**
+ * 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;
+ }
+}
--- /dev/null
+/**
+ * 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;
+ }
+}
--- /dev/null
+/**
+ * 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;
+ }
+}
+++ /dev/null
-/**
- * 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;
- }
-}
+++ /dev/null
-/**
- * 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;
- }
-}
+++ /dev/null
-/**
- * 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;
- }
-}
+++ /dev/null
-/**
- * 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;
- }
-}
+++ /dev/null
-/**
- * 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;
- }
-}
+++ /dev/null
-/**
- * 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;
- }
-}
*/
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;
}
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;