]> git.basschouten.com Git - openhab-addons.git/commitdiff
[evohome] Add null annotation and minor refactoring (#13885)
authorlsiepel <leosiepel@gmail.com>
Fri, 24 Feb 2023 15:08:53 +0000 (16:08 +0100)
committerGitHub <noreply@github.com>
Fri, 24 Feb 2023 15:08:53 +0000 (16:08 +0100)
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
75 files changed:
bundles/org.openhab.binding.evohome/README.md
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/EvohomeBindingConstants.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/RunnableWithTimeout.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/ApiAccess.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiClient.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiClientException.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiConstants.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/HeatSetPoint.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/HeatSetPointBuilder.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/Mode.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/ModeBuilder.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/RequestBuilder.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/TimedRequestBuilder.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/ActiveFault.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Authentication.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Gateway.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/GatewayInfo.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/GatewayStatus.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/HeatSetpointCapabilities.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/HeatSetpointStatus.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Location.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationInfo.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationOwner.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationStatus.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Locations.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationsStatus.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Mode.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/ScheduleCapabilities.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/SystemModeStatus.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TemperatureControlSystem.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TemperatureControlSystemStatus.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TemperatureStatus.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TimeZone.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/UserAccount.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Zone.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/ZoneStatus.java [new file with mode: 0644]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPoint.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPointBuilder.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/Mode.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/ModeBuilder.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/RequestBuilder.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/TimedRequestBuilder.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ActiveFault.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Authentication.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Gateway.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayInfo.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayStatus.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointCapabilities.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointStatus.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Location.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationInfo.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationOwner.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationStatus.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Locations.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationsStatus.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Mode.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ScheduleCapabilities.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/SystemModeStatus.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystem.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystemStatus.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureStatus.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TimeZone.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/UserAccount.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Zone.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ZoneStatus.java [deleted file]
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeAccountConfiguration.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeTemperatureControlSystemConfiguration.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeThingConfiguration.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/discovery/EvohomeDiscoveryService.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/AccountStatusListener.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/BaseEvohomeHandler.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeAccountBridgeHandler.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeHeatingZoneHandler.java
bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeTemperatureControlSystemHandler.java
bundles/org.openhab.binding.evohome/src/main/resources/OH-INF/thing/channels.xml

index 4df91715638218a20974347dcd8ccb93503cd5c5..65744fd22298089b08c68f83783da28dc637c337 100644 (file)
@@ -64,11 +64,12 @@ None
 
 ### Zone
 
-| Channel Type ID   | Item Type | Description                                                                                                                                                                                                            |
-|-------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| Temperature       | Number    | Allows for viewing the current actual temperature of the zone.                                                                                                                                                     |
-| SetPointStatus    | String    | Allows for viewing the current set point mode of the zone.                                                                                                                                                      |
-| SetPoint          | Number    | Allows for viewing and permanently overriding the temperature set point of the zone. Sending 0 cancels any active set point overrides.                                                                                                                                         |
+| Channel Type ID | Item Type          | Description                                                                                                                            |
+|-----------------|--------------------|----------------------------------------------------------------------------------------------------------------------------------------|
+| Temperature     | Number:Temperature | Allows for viewing the current actual temperature of the zone.                                                                         |
+| SetPointStatus  | String             | Allows for viewing the current set point mode of the zone.                                                                             |
+| SetPoint        | Number:Temperature | Allows for viewing and permanently overriding the temperature set point of the zone. Sending 0 cancels any active set point overrides. |
+                                                                                                                                 |
 
 ## Full Example
 
@@ -89,9 +90,9 @@ Bridge evohome:account:your_account_alias [ username="your_user_name", password=
 String DemoMode                 { channel="evohome:display:your_account_alias:your_display_alias:SystemMode" }
 
 // evohome Heatingzone
-Number DemoZoneTemperature    { channel="evohome:heatingzone:your_account_alias:your_zone_alias:Temperature" }
-String DemoZoneSetPointStatus { channel="evohome:heatingzone:your_account_alias:your_zone_alias:SetPointStatus" }
-Number DemoZoneSetPoint       { channel="evohome:heatingzone:your_account_alias:your_zone_alias:SetPoint" }
+Number:Temperature DemoZoneTemperature  { channel="evohome:heatingzone:your_account_alias:your_zone_alias:Temperature" }
+String DemoZoneSetPointStatus           { channel="evohome:heatingzone:your_account_alias:your_zone_alias:SetPointStatus" }
+Number:Temperature DemoZoneSetPoint     { channel="evohome:heatingzone:your_account_alias:your_zone_alias:SetPoint" }
 ```
 
 ### demo.sitemap
index 2c07a7773721ab6ef29d7e69cc888ee09ace0c34..d416730cd5d4ef8fc637967704bc7d1c5bccf57e 100644 (file)
@@ -17,6 +17,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.openhab.core.thing.ThingTypeUID;
 
 /**
@@ -26,6 +27,7 @@ import org.openhab.core.thing.ThingTypeUID;
  * @author Jasper van Zuijlen - Initial contribution
  * @author Neil Renaud - Heating Zones
  */
+@NonNullByDefault
 public class EvohomeBindingConstants {
 
     private static final String BINDING_ID = "evohome";
index 0cb741839f8481627268b739ad666acddc89c183..ea7b90a15828d28cc14c8dbeb6e70d3bff1e9db8 100644 (file)
@@ -14,12 +14,15 @@ package org.openhab.binding.evohome.internal;
 
 import java.util.concurrent.TimeoutException;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
 /**
  * Provides an interface for a delegate that can throw a timeout
  *
  * @author Jasper van Zuijlen - Initial contribution
  *
  */
+@NonNullByDefault
 public interface RunnableWithTimeout {
 
     public abstract void run() throws TimeoutException;
index cb2335e7473b9ff00814f463eaf4ac1238796fb4..60c8cbac3ed991b2dda89e8e8a157bec77584768 100644 (file)
@@ -18,13 +18,15 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.jetty.client.HttpClient;
 import org.eclipse.jetty.client.api.ContentResponse;
 import org.eclipse.jetty.client.api.Request;
 import org.eclipse.jetty.client.util.StringContentProvider;
 import org.eclipse.jetty.http.HttpMethod;
 import org.eclipse.jetty.http.HttpStatus;
-import org.openhab.binding.evohome.internal.api.models.v2.response.Authentication;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Authentication;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -37,17 +39,17 @@ import com.google.gson.GsonBuilder;
  * @author Jasper van Zuijlen - Initial contribution
  *
  */
+@NonNullByDefault
 public class ApiAccess {
     private static final int REQUEST_TIMEOUT_SECONDS = 5;
     private final Logger logger = LoggerFactory.getLogger(ApiAccess.class);
     private final HttpClient httpClient;
-    private final Gson gson;
+    private final Gson gson = new GsonBuilder().create();
 
-    private Authentication authenticationData;
-    private String applicationId;
+    private @Nullable Authentication authenticationData;
+    private @Nullable String applicationId;
 
     public ApiAccess(HttpClient httpClient) {
-        this.gson = new GsonBuilder().create();
         this.httpClient = httpClient;
     }
 
@@ -56,7 +58,7 @@ public class ApiAccess {
      *
      * @param authentication The authentication details to apply
      */
-    public void setAuthentication(Authentication authentication) {
+    public void setAuthentication(@Nullable Authentication authentication) {
         authenticationData = authentication;
     }
 
@@ -65,7 +67,7 @@ public class ApiAccess {
      *
      * @return The current authentication details
      */
-    public Authentication getAuthentication() {
+    public @Nullable Authentication getAuthentication() {
         return authenticationData;
     }
 
@@ -74,7 +76,7 @@ public class ApiAccess {
      *
      * @param applicationId The application id to apply
      */
-    public void setApplicationId(String applicationId) {
+    public void setApplicationId(@Nullable String applicationId) {
         this.applicationId = applicationId;
     }
 
@@ -89,18 +91,16 @@ public class ApiAccess {
      * @return The result of the request or null
      * @throws TimeoutException Thrown when a request times out
      */
-    public <TOut> TOut doRequest(HttpMethod method, String url, Map<String, String> headers, String requestData,
-            String contentType, Class<TOut> outClass) throws TimeoutException {
-        TOut retVal = null;
+    public @Nullable <TOut> TOut doRequest(HttpMethod method, String url, Map<String, String> headers,
+            @Nullable String requestData, String contentType, @Nullable Class<TOut> outClass) throws TimeoutException {
         logger.debug("Requesting: [{}]", url);
-
+        @Nullable
+        TOut retVal = null;
         try {
             Request request = httpClient.newRequest(url).method(method);
 
-            if (headers != null) {
-                for (Map.Entry<String, String> header : headers.entrySet()) {
-                    request.header(header.getKey(), header.getValue());
-                }
+            for (Map.Entry<String, String> header : headers.entrySet()) {
+                request.header(header.getKey(), header.getValue());
             }
 
             if (requestData != null) {
@@ -109,8 +109,8 @@ public class ApiAccess {
 
             ContentResponse response = request.timeout(REQUEST_TIMEOUT_SECONDS, TimeUnit.SECONDS).send();
 
-            logger.debug("Response: {}", response);
-            logger.debug("\n{}\n{}", response.getHeaders(), response.getContentAsString());
+            logger.trace("Response: {}", response);
+            logger.trace("\n{}\n{}", response.getHeaders(), response.getContentAsString());
 
             if ((response.getStatus() == HttpStatus.OK_200) || (response.getStatus() == HttpStatus.ACCEPTED_202)) {
                 String reply = response.getContentAsString();
@@ -118,6 +118,10 @@ public class ApiAccess {
                 if (outClass != null) {
                     retVal = new Gson().fromJson(reply, outClass);
                 }
+            } else if ((response.getStatus() == HttpStatus.CREATED_201)) {
+                // success nothing to return ignore
+            } else {
+                logger.debug("Request failed with unexpected response code {}", response.getStatus());
             }
         } catch (ExecutionException e) {
             logger.debug("Error in handling request: ", e);
@@ -125,7 +129,6 @@ public class ApiAccess {
             logger.debug("Handling request interrupted: ", e);
             Thread.currentThread().interrupt();
         }
-
         return retVal;
     }
 
@@ -138,7 +141,7 @@ public class ApiAccess {
      * @return The result of the request or null
      * @throws TimeoutException Thrown when a request times out
      */
-    public <TOut> TOut doAuthenticatedGet(String url, Class<TOut> outClass) throws TimeoutException {
+    public @Nullable <TOut> TOut doAuthenticatedGet(String url, Class<TOut> outClass) throws TimeoutException {
         return doAuthenticatedRequest(HttpMethod.GET, url, null, outClass);
     }
 
@@ -161,16 +164,16 @@ public class ApiAccess {
      * @param method The HTTP method to use (POST, GET, ...)
      * @param url The URL to query
      * @param headers The optional additional headers to apply, can be null
-     * @param requestContainer The object to use as JSON data for the request
-     * @param outClass The type of the requested result
+     * @param requestContainer The object to use as JSON data for the request, can be null
+     * @param outClass The type of the requested result, can be null
      * @return The result of the request or null
      * @throws TimeoutException Thrown when a request times out
      */
-    private <TOut> TOut doRequest(HttpMethod method, String url, Map<String, String> headers, Object requestContainer,
-            Class<TOut> outClass) throws TimeoutException {
+    private @Nullable <TOut> TOut doRequest(HttpMethod method, String url, Map<String, String> headers,
+            @Nullable Object requestContainer, @Nullable Class<TOut> outClass) throws TimeoutException {
         String json = null;
         if (requestContainer != null) {
-            json = this.gson.toJson(requestContainer);
+            json = gson.toJson(requestContainer);
         }
 
         return doRequest(method, url, headers, json, "application/json", outClass);
@@ -188,17 +191,19 @@ public class ApiAccess {
      * @return The result of the request or null
      * @throws TimeoutException Thrown when a request times out
      */
-    private <TOut> TOut doAuthenticatedRequest(HttpMethod method, String url, Object requestContainer,
-            Class<TOut> outClass) throws TimeoutException {
-        Map<String, String> headers = null;
-        if (authenticationData != null) {
-            headers = new HashMap<>();
-
-            headers.put("Authorization", "Bearer " + authenticationData.getAccessToken());
-            headers.put("applicationId", applicationId);
-            headers.put("Accept",
-                    "application/json, application/xml, text/json, text/x-json, text/javascript, text/xml");
+    private @Nullable <TOut> TOut doAuthenticatedRequest(HttpMethod method, String url,
+            @Nullable Object requestContainer, @Nullable Class<TOut> outClass) throws TimeoutException {
+        Map<String, String> headers = new HashMap<>();
+        Authentication localAuthenticationData = authenticationData;
+        String localApplicationId = applicationId;
+
+        if (localAuthenticationData != null) {
+            headers.put("Authorization", "Bearer " + localAuthenticationData.getAccessToken());
+        }
+        if (localApplicationId != null) {
+            headers.put("applicationId", localApplicationId);
         }
+        headers.put("Accept", "application/json, application/xml, text/json, text/x-json, text/javascript, text/xml");
 
         return doRequest(method, url, headers, requestContainer, outClass);
     }
index 477d68a79459bd6f1cc42ce87d2dc6c4302195ff..eaceccf87a1f661beda76be26b48fa19e54178db 100644 (file)
@@ -19,18 +19,20 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.TimeoutException;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.jetty.client.HttpClient;
 import org.eclipse.jetty.http.HttpMethod;
-import org.openhab.binding.evohome.internal.api.models.v2.request.HeatSetPoint;
-import org.openhab.binding.evohome.internal.api.models.v2.request.HeatSetPointBuilder;
-import org.openhab.binding.evohome.internal.api.models.v2.request.Mode;
-import org.openhab.binding.evohome.internal.api.models.v2.request.ModeBuilder;
-import org.openhab.binding.evohome.internal.api.models.v2.response.Authentication;
-import org.openhab.binding.evohome.internal.api.models.v2.response.Location;
-import org.openhab.binding.evohome.internal.api.models.v2.response.LocationStatus;
-import org.openhab.binding.evohome.internal.api.models.v2.response.Locations;
-import org.openhab.binding.evohome.internal.api.models.v2.response.LocationsStatus;
-import org.openhab.binding.evohome.internal.api.models.v2.response.UserAccount;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.request.HeatSetPoint;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.request.HeatSetPointBuilder;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.request.Mode;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.request.ModeBuilder;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Authentication;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Location;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.LocationStatus;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Locations;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.LocationsStatus;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.UserAccount;
 import org.openhab.binding.evohome.internal.configuration.EvohomeAccountConfiguration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -41,6 +43,7 @@ import org.slf4j.LoggerFactory;
  * @author Jasper van Zuijlen - Initial contribution
  *
  */
+@NonNullByDefault
 public class EvohomeApiClient {
 
     private static final String APPLICATION_ID = "b013aa26-9724-4dbd-8897-048b9aada249";
@@ -52,8 +55,8 @@ public class EvohomeApiClient {
     private final ApiAccess apiAccess;
 
     private Locations locations = new Locations();
-    private UserAccount useraccount;
-    private LocationsStatus locationsStatus;
+    private @Nullable UserAccount useraccount;
+    private @Nullable LocationsStatus locationsStatus;
 
     /**
      * Creates a new API client based on the V2 API interface
@@ -72,7 +75,7 @@ public class EvohomeApiClient {
     public void close() {
         apiAccess.setAuthentication(null);
         useraccount = null;
-        locations = null;
+        locations = new Locations();
         locationsStatus = null;
     }
 
@@ -113,7 +116,7 @@ public class EvohomeApiClient {
         return locations;
     }
 
-    public LocationsStatus getInstallationStatus() {
+    public @Nullable LocationsStatus getInstallationStatus() {
         return locationsStatus;
     }
 
@@ -139,33 +142,33 @@ public class EvohomeApiClient {
         apiAccess.doAuthenticatedPut(url, heatSetPoint);
     }
 
-    private UserAccount requestUserAccount() throws TimeoutException {
+    private @Nullable UserAccount requestUserAccount() throws TimeoutException {
         String url = EvohomeApiConstants.URL_V2_BASE + EvohomeApiConstants.URL_V2_ACCOUNT;
         return apiAccess.doAuthenticatedGet(url, UserAccount.class);
     }
 
     private Locations requestLocations() throws TimeoutException {
-        Locations locations = new Locations();
-        if (useraccount != null) {
+        Locations locations = null;
+        UserAccount localAccount = useraccount;
+        if (localAccount != null) {
             String url = EvohomeApiConstants.URL_V2_BASE + EvohomeApiConstants.URL_V2_INSTALLATION_INFO;
-            url = String.format(url, useraccount.getUserId());
+            url = String.format(url, localAccount.getUserId());
 
             locations = apiAccess.doAuthenticatedGet(url, Locations.class);
         }
-        return locations;
+        return locations != null ? locations : new Locations();
     }
 
     private LocationsStatus requestLocationsStatus() throws TimeoutException {
         LocationsStatus locationsStatus = new LocationsStatus();
 
-        if (locations != null) {
-            for (Location location : locations) {
-                String url = EvohomeApiConstants.URL_V2_BASE + EvohomeApiConstants.URL_V2_LOCATION_STATUS;
-                url = String.format(url, location.getLocationInfo().getLocationId());
-                LocationStatus status = apiAccess.doAuthenticatedGet(url, LocationStatus.class);
-                locationsStatus.add(status);
-            }
+        for (Location location : locations) {
+            String url = EvohomeApiConstants.URL_V2_BASE + EvohomeApiConstants.URL_V2_LOCATION_STATUS;
+            url = String.format(url, location.getLocationInfo().getLocationId());
+            LocationStatus status = apiAccess.doAuthenticatedGet(url, LocationStatus.class);
+            locationsStatus.add(status);
         }
+
         return locationsStatus;
     }
 
index a622e00c16bdb6145258b18c1903d7206b7dcabd..850879f8aaedbbd5a4bce5428f25106ba7aca1df 100644 (file)
  */
 package org.openhab.binding.evohome.internal.api;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
 /**
  * Exception for errors from the API Client.
  *
  * @author Jasper van Zuijlen - Initial contribution
  *
  */
+@NonNullByDefault
 public class EvohomeApiClientException extends Exception {
+    private static final long serialVersionUID = 1L;
 
     public EvohomeApiClientException() {
     }
index c0237c7e7155155e2632cc42930a4e40ef36536c..d35e3cd82adbbbeb0359b9c2df8e24246b208399 100644 (file)
  */
 package org.openhab.binding.evohome.internal.api;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
 /**
  * List of evohome API constants
  *
  * @author Jasper van Zuijlen - Initial contribution
  *
  */
+@NonNullByDefault
 public class EvohomeApiConstants {
     public static final String URL_V2_AUTH = "https://tccna.honeywell.com/Auth/OAuth/Token";
 
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/HeatSetPoint.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/HeatSetPoint.java
new file mode 100644 (file)
index 0000000..7a4168c
--- /dev/null
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.request;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Request model for the mode
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class HeatSetPoint {
+
+    /**
+     * Constructs an override reset
+     */
+    HeatSetPoint() {
+        heatSetpointValue = 0.0;
+        setpointMode = "FollowSchedule";
+        timeUntil = null;
+    }
+
+    /**
+     * Constructs a permanent override with the given temperature
+     *
+     * @param setPoint The target temperature to set the set point to
+     */
+    HeatSetPoint(double setPoint) {
+        // Make sure that the value is rounded toward the nearest 0.5
+        heatSetpointValue = Math.round(setPoint * 2) / 2.0;
+        setpointMode = "PermanentOverride";
+        timeUntil = null;
+    }
+
+    @SuppressWarnings("unused")
+    @SerializedName("heatSetpointValue")
+    private double heatSetpointValue;
+
+    @SuppressWarnings("unused")
+    @SerializedName("setpointMode")
+    private String setpointMode;
+
+    @SuppressWarnings("unused")
+    @SerializedName("timeUntil")
+    private String timeUntil;
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/HeatSetPointBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/HeatSetPointBuilder.java
new file mode 100644 (file)
index 0000000..5eb458f
--- /dev/null
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.request;
+
+/**
+ * Builder for heat set point API requests
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class HeatSetPointBuilder implements RequestBuilder<HeatSetPoint> {
+
+    private double setPoint;
+    private boolean hasSetPoint;
+    private boolean cancelSetPoint;
+
+    /**
+     * Creates a new heat set point command
+     *
+     * @return A heat set point command or null when the configuration is invalid
+     *
+     */
+    @Override
+    public HeatSetPoint build() {
+        if (cancelSetPoint) {
+            return new HeatSetPoint();
+        }
+        if (hasSetPoint) {
+            return new HeatSetPoint(setPoint);
+        }
+        return null;
+    }
+
+    public HeatSetPointBuilder setSetPoint(double setPoint) {
+        this.hasSetPoint = true;
+        this.setPoint = setPoint;
+        return this;
+    }
+
+    public HeatSetPointBuilder setCancelSetPoint() {
+        cancelSetPoint = true;
+        return this;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/Mode.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/Mode.java
new file mode 100644 (file)
index 0000000..125147f
--- /dev/null
@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.request;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Request model for the mode
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class Mode {
+
+    Mode(String mode) {
+        systemMode = mode;
+        timeUntil = null;
+        permanent = true;
+    }
+
+    Mode(String mode, int day, int month, int year) {
+        systemMode = mode;
+        timeUntil = String.format("%s-%s-%sT00:00:00Z", year, month, day);
+        permanent = false;
+    }
+
+    @SuppressWarnings("unused")
+    @SerializedName("systemMode")
+    private String systemMode;
+
+    @SuppressWarnings("unused")
+    @SerializedName("timeUntil")
+    private String timeUntil;
+
+    @SuppressWarnings("unused")
+    @SerializedName("permanent")
+    private boolean permanent;
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/ModeBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/ModeBuilder.java
new file mode 100644 (file)
index 0000000..92bee41
--- /dev/null
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.request;
+
+/**
+ * Builder for mode API requests
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class ModeBuilder extends TimedRequestBuilder<Mode> {
+
+    private String mode;
+    private boolean hasSetMode;
+
+    /**
+     * Creates a new mode command
+     *
+     * @return A mode command or null when the configuration is invalid
+     *
+     */
+    @Override
+    public Mode build() {
+        if (hasSetMode) {
+            if (useEndTime()) {
+                return new Mode(mode, getYear(), getMonth(), getDay());
+            } else {
+                return new Mode(mode);
+            }
+        }
+        return null;
+    }
+
+    public ModeBuilder setMode(String mode) {
+        this.hasSetMode = true;
+        this.mode = mode;
+        return this;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/RequestBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/RequestBuilder.java
new file mode 100644 (file)
index 0000000..048b3ae
--- /dev/null
@@ -0,0 +1,24 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.request;
+
+/**
+ * Builder for API requests
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public interface RequestBuilder<T> {
+
+    public T build();
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/TimedRequestBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/request/TimedRequestBuilder.java
new file mode 100644 (file)
index 0000000..829ea94
--- /dev/null
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.request;
+
+/**
+ * Builder for timed API requests
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public abstract class TimedRequestBuilder<T> implements RequestBuilder<T> {
+    private boolean useEndTime;
+    private int year;
+    private int month;
+    private int day;
+
+    public RequestBuilder<T> withEndTime(int year, int month, int day) {
+        this.useEndTime = true;
+        this.year = year;
+        this.month = month;
+        this.day = day;
+        return this;
+    }
+
+    protected boolean useEndTime() {
+        return useEndTime;
+    }
+
+    protected int getYear() {
+        return year;
+    }
+
+    protected int getMonth() {
+        return month;
+    }
+
+    protected int getDay() {
+        return day;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/ActiveFault.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/ActiveFault.java
new file mode 100644 (file)
index 0000000..790054d
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the active fault
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class ActiveFault {
+
+    @SerializedName("faultType")
+    private String faultType;
+
+    @SerializedName("since")
+    private String since;
+
+    public String getFaultType() {
+        return faultType;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Authentication.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Authentication.java
new file mode 100644 (file)
index 0000000..ac90b23
--- /dev/null
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the authentication
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class Authentication {
+
+    @SerializedName("access_token")
+    private String accessToken;
+
+    @SerializedName("token_type")
+    private String tokenType;
+
+    @SerializedName("expires_in")
+    private int expiresIn;
+
+    @SerializedName("refresh_token")
+    private String refreshToken;
+
+    @SerializedName("scope")
+    private String scope;
+
+    /** Convenience variable for current system time in seconds */
+    private long systemTime;
+
+    public String getAccessToken() {
+        return accessToken;
+    }
+
+    public int getExpiresIn() {
+        return expiresIn;
+    }
+
+    public String getRefreshToken() {
+        return refreshToken;
+    }
+
+    public void setSystemTime(long systemTime) {
+        this.systemTime = systemTime;
+    }
+
+    public long getSystemTime() {
+        return systemTime;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Gateway.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Gateway.java
new file mode 100644 (file)
index 0000000..154d855
--- /dev/null
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the gateway
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class Gateway {
+
+    @SerializedName("gatewayInfo")
+    private GatewayInfo gatewayInfo;
+
+    @SerializedName("temperatureControlSystems")
+    private List<TemperatureControlSystem> temperatureControlSystems;
+
+    public GatewayInfo getGatewayInfo() {
+        return gatewayInfo;
+    }
+
+    public List<TemperatureControlSystem> getTemperatureControlSystems() {
+        return temperatureControlSystems;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/GatewayInfo.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/GatewayInfo.java
new file mode 100644 (file)
index 0000000..c6a572a
--- /dev/null
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the gateway info
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class GatewayInfo {
+
+    @SerializedName("gatewayId")
+    private String gatewayId;
+
+    @SerializedName("mac")
+    private String macAddress;
+
+    @SerializedName("crc")
+    private String crc;
+
+    @SerializedName("isWiFi")
+    private boolean isWifi;
+
+    public String getGatewayId() {
+        return gatewayId;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/GatewayStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/GatewayStatus.java
new file mode 100644 (file)
index 0000000..0a91eb5
--- /dev/null
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the gateway status
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class GatewayStatus {
+
+    @SerializedName("gatewayId")
+    private String gatewayId;
+
+    @SerializedName("temperatureControlSystems")
+    private List<TemperatureControlSystemStatus> temperatureControlSystems;
+
+    @SerializedName("activeFaults")
+    private List<ActiveFault> activeFaults;
+
+    public List<TemperatureControlSystemStatus> getTemperatureControlSystems() {
+        return temperatureControlSystems;
+    }
+
+    public boolean hasActiveFaults() {
+        return !activeFaults.isEmpty();
+    }
+
+    public ActiveFault getActiveFault(int index) {
+        return activeFaults.get(index);
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/HeatSetpointCapabilities.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/HeatSetpointCapabilities.java
new file mode 100644 (file)
index 0000000..ffc222a
--- /dev/null
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the heat set point capabilities
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class HeatSetpointCapabilities {
+
+    @SerializedName("maxHeatSetpoint")
+    private double maxHeatSetpoint;
+
+    @SerializedName("minHeatSetpoint")
+    private double minHeatSetpoint;
+
+    @SerializedName("valueResolution")
+    private double valueResolution;
+
+    @SerializedName("allowedSetpointModes")
+    private List<String> allowedSetpointModes;
+
+    @SerializedName("maxDuration")
+    private String maxDuration;
+
+    @SerializedName("timingResolution")
+    private String timingResolution;
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/HeatSetpointStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/HeatSetpointStatus.java
new file mode 100644 (file)
index 0000000..924b407
--- /dev/null
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the heat setpoint status
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class HeatSetpointStatus {
+
+    @SerializedName("targetHeatTemperature")
+    private double targetTemperature;
+
+    @SerializedName("setpointMode")
+    private String setpointMode;
+
+    public double getTargetTemperature() {
+        return targetTemperature;
+    }
+
+    public String getSetpointMode() {
+        return setpointMode;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Location.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Location.java
new file mode 100644 (file)
index 0000000..6a7d978
--- /dev/null
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the location
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class Location {
+
+    @SerializedName("locationInfo")
+    private LocationInfo locationInfo;
+
+    @SerializedName("gateways")
+    private List<Gateway> gateways;
+
+    public LocationInfo getLocationInfo() {
+        return locationInfo;
+    }
+
+    public List<Gateway> getGateways() {
+        return gateways;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationInfo.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationInfo.java
new file mode 100644 (file)
index 0000000..66575c7
--- /dev/null
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the location info
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class LocationInfo {
+
+    @SerializedName("locationId")
+    private String locationId;
+
+    @SerializedName("name")
+    private String name;
+
+    @SerializedName("streetAddress")
+    private String streetAddress;
+
+    @SerializedName("city")
+    private String city;
+
+    @SerializedName("country")
+    private String country;
+
+    @SerializedName("postcode")
+    private String postcode;
+
+    @SerializedName("locationType")
+    private String locationType;
+
+    @SerializedName("useDaylightSaveSwitching")
+    private boolean useDaylightSaveSwitching;
+
+    @SerializedName("timeZone")
+    private TimeZone timeZone;
+
+    @SerializedName("locationOwner")
+    private LocationOwner locationOwner;
+
+    public String getLocationId() {
+        return locationId;
+    }
+
+    public String getName() {
+        return name;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationOwner.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationOwner.java
new file mode 100644 (file)
index 0000000..1952f43
--- /dev/null
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the location owner
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class LocationOwner {
+
+    @SerializedName("userId")
+    private int userId;
+
+    @SerializedName("username")
+    private String username;
+
+    @SerializedName("firstname")
+    private String firstName;
+
+    @SerializedName("lastname")
+    private String lastName;
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationStatus.java
new file mode 100644 (file)
index 0000000..22caadc
--- /dev/null
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the location status
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class LocationStatus {
+
+    @SerializedName("locationId")
+    private String locationId;
+
+    @SerializedName("gateways")
+    private List<GatewayStatus> gateways;
+
+    public LocationStatus() {
+        locationId = "";
+        gateways = new ArrayList<>();
+    }
+
+    public List<GatewayStatus> getGateways() {
+        return gateways;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Locations.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Locations.java
new file mode 100644 (file)
index 0000000..f0a18bc
--- /dev/null
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import java.util.ArrayList;
+
+/**
+ * Alias for a list of locations
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class Locations extends ArrayList<Location> {
+    private static final long serialVersionUID = 1L;
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationsStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/LocationsStatus.java
new file mode 100644 (file)
index 0000000..a40bcb3
--- /dev/null
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import java.util.ArrayList;
+
+/**
+ * Alias for a list of location statuses
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class LocationsStatus extends ArrayList<LocationStatus> {
+    private static final long serialVersionUID = 1L;
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Mode.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Mode.java
new file mode 100644 (file)
index 0000000..cd09112
--- /dev/null
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the mode
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class Mode {
+
+    @SerializedName("systemMode")
+    private String systemMode;
+
+    @SerializedName("canBePermanent")
+    private boolean canBePermanent;
+
+    @SerializedName("canBeTemporary")
+    private boolean canBeTemporary;
+
+    @SerializedName("timingMode")
+    private String timingMode;
+
+    @SerializedName("maxDuration")
+    private String maxDuration;
+
+    @SerializedName("timingResolution")
+    private String timingResolution;
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/ScheduleCapabilities.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/ScheduleCapabilities.java
new file mode 100644 (file)
index 0000000..9e86e51
--- /dev/null
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the schedule capabilities
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class ScheduleCapabilities {
+
+    @SerializedName("maxSwitchpointsPerDay")
+    private int maxSwitchpointsPerDay;
+
+    @SerializedName("minSwitchpointsPerDay")
+    private int minSwitchpointsPerDay;
+
+    @SerializedName("setpointValueResolution")
+    private double setpointValueResolution;
+
+    @SerializedName("timingResolution")
+    private String timingResolution;
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/SystemModeStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/SystemModeStatus.java
new file mode 100644 (file)
index 0000000..93e7958
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the system mode status
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class SystemModeStatus {
+
+    @SerializedName("mode")
+    private String mode;
+
+    @SerializedName("isPermanent")
+    private boolean isPermanent;
+
+    public String getMode() {
+        return mode;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TemperatureControlSystem.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TemperatureControlSystem.java
new file mode 100644 (file)
index 0000000..3eecdfc
--- /dev/null
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the temperature control system
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class TemperatureControlSystem {
+
+    @SerializedName("systemId")
+    private String systemId;
+
+    @SerializedName("modelType")
+    private String modelType;
+
+    @SerializedName("zones")
+    private List<Zone> zones;
+
+    @SerializedName("allowedSystemModes")
+    private List<Mode> allowedSystemModes;
+
+    public String getSystemId() {
+        return systemId;
+    }
+
+    public List<Zone> getZones() {
+        return zones;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TemperatureControlSystemStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TemperatureControlSystemStatus.java
new file mode 100644 (file)
index 0000000..555e7bd
--- /dev/null
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the temperature control system status
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class TemperatureControlSystemStatus {
+
+    @SerializedName("systemId")
+    private String systemId;
+
+    @SerializedName("systemModeStatus")
+    private SystemModeStatus mode;
+
+    @SerializedName("zones")
+    private List<ZoneStatus> zones;
+
+    @SerializedName("activeFaults")
+    private List<ActiveFault> activeFaults;
+
+    public String getSystemId() {
+        return systemId;
+    }
+
+    public SystemModeStatus getMode() {
+        return mode;
+    }
+
+    public List<ZoneStatus> getZones() {
+        return zones;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TemperatureStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TemperatureStatus.java
new file mode 100644 (file)
index 0000000..c064c1b
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the temperature status
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class TemperatureStatus {
+
+    @SerializedName("temperature")
+    private double temperature;
+
+    @SerializedName("isAvailable")
+    private boolean isAvailable;
+
+    public double getTemperature() {
+        return temperature;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TimeZone.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/TimeZone.java
new file mode 100644 (file)
index 0000000..e91f527
--- /dev/null
@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the time zone
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class TimeZone {
+
+    @SerializedName("timeZoneId")
+    private String timeZoneId;
+
+    @SerializedName("displayName")
+    private String displayName;
+
+    @SerializedName("offsetMinutes")
+    private int offsetMinutes;
+
+    @SerializedName("currentOffsetMinutes")
+    private int currentOffsetMinutes;
+
+    @SerializedName("supportsDaylightSaving")
+    private boolean supportsDaylightSaving;
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/UserAccount.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/UserAccount.java
new file mode 100644 (file)
index 0000000..386638b
--- /dev/null
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the user account
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class UserAccount {
+
+    @SerializedName("userId")
+    private String userId;
+
+    @SerializedName("username")
+    private String userName;
+
+    @SerializedName("firstname")
+    private String firstName;
+
+    @SerializedName("lastname")
+    private String lastName;
+
+    @SerializedName("streetAddress")
+    private String streetAddress;
+
+    @SerializedName("city")
+    private String city;
+
+    @SerializedName("postcode")
+    private String postCode;
+
+    @SerializedName("country")
+    private String country;
+
+    @SerializedName("language")
+    private String language;
+
+    public String getUserId() {
+        return userId;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Zone.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/Zone.java
new file mode 100644 (file)
index 0000000..933fd9a
--- /dev/null
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for the zone
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class Zone {
+
+    @SerializedName("zoneId")
+    private String zoneId;
+
+    @SerializedName("modelType")
+    private String modelType;
+
+    @SerializedName("name")
+    private String name;
+
+    @SerializedName("zoneType")
+    private String zoneType;
+
+    @SerializedName("heatSetpointCapabilities")
+    private HeatSetpointCapabilities heatSetpointCapabilities;
+
+    @SerializedName("scheduleCapabilities")
+    private ScheduleCapabilities scheduleCapabilities;
+
+    public String getZoneId() {
+        return zoneId;
+    }
+
+    public String getName() {
+        return name;
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/ZoneStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/dto/response/ZoneStatus.java
new file mode 100644 (file)
index 0000000..053bc11
--- /dev/null
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.dto.response;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Response model for zone status
+ *
+ * @author Jasper van Zuijlen - Initial contribution
+ *
+ */
+public class ZoneStatus {
+
+    @SerializedName("zoneId")
+    private String zoneId;
+
+    @SerializedName("name")
+    private String name;
+
+    @SerializedName("temperatureStatus")
+    private TemperatureStatus temperature;
+
+    @SerializedName("setpointStatus")
+    private HeatSetpointStatus heatSetpoint;
+
+    @SerializedName("activeFaults")
+    private List<ActiveFault> activeFaults;
+
+    public String getZoneId() {
+        return zoneId;
+    }
+
+    public TemperatureStatus getTemperature() {
+        return temperature;
+    }
+
+    public HeatSetpointStatus getHeatSetpoint() {
+        return heatSetpoint;
+    }
+
+    public boolean hasActiveFaults() {
+        return !activeFaults.isEmpty();
+    }
+
+    public ActiveFault getActiveFault(int index) {
+        return activeFaults.get(index);
+    }
+}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPoint.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPoint.java
deleted file mode 100644 (file)
index 127841b..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.request;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Request model for the mode
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class HeatSetPoint {
-
-    /**
-     * Constructs an override reset
-     */
-    HeatSetPoint() {
-        heatSetpointValue = 0.0;
-        setpointMode = "FollowSchedule";
-        timeUntil = null;
-    }
-
-    /**
-     * Constructs a permanent override with the given temperature
-     *
-     * @param setPoint The target temperature to set the set point to
-     */
-    HeatSetPoint(double setPoint) {
-        // Make sure that the value is rounded toward the nearest 0.5
-        heatSetpointValue = Math.round(setPoint * 2) / 2.0;
-        setpointMode = "PermanentOverride";
-        timeUntil = null;
-    }
-
-    @SerializedName("heatSetpointValue")
-    private double heatSetpointValue;
-
-    @SerializedName("setpointMode")
-    private String setpointMode;
-
-    @SerializedName("timeUntil")
-    private String timeUntil;
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPointBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPointBuilder.java
deleted file mode 100644 (file)
index abc90ed..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.request;
-
-/**
- * Builder for heat set point API requests
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class HeatSetPointBuilder implements RequestBuilder<HeatSetPoint> {
-
-    private double setPoint;
-    private boolean hasSetPoint;
-    private boolean cancelSetPoint;
-
-    /**
-     * Creates a new heat set point command
-     *
-     * @return A heat set point command or null when the configuration is invalid
-     *
-     */
-    @Override
-    public HeatSetPoint build() {
-        if (cancelSetPoint) {
-            return new HeatSetPoint();
-        }
-        if (hasSetPoint) {
-            return new HeatSetPoint(setPoint);
-        }
-        return null;
-    }
-
-    public HeatSetPointBuilder setSetPoint(double setPoint) {
-        this.hasSetPoint = true;
-        this.setPoint = setPoint;
-        return this;
-    }
-
-    public HeatSetPointBuilder setCancelSetPoint() {
-        cancelSetPoint = true;
-        return this;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/Mode.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/Mode.java
deleted file mode 100644 (file)
index 0a58be0..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.request;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Request model for the mode
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class Mode {
-
-    Mode(String mode) {
-        systemMode = mode;
-        timeUntil = null;
-        permanent = true;
-    }
-
-    Mode(String mode, int day, int month, int year) {
-        systemMode = mode;
-        timeUntil = String.format("%s-%s-%sT00:00:00Z", year, month, day);
-        permanent = false;
-    }
-
-    @SerializedName("systemMode")
-    private String systemMode;
-
-    @SerializedName("timeUntil")
-    private String timeUntil;
-
-    @SerializedName("permanent")
-    private boolean permanent;
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/ModeBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/ModeBuilder.java
deleted file mode 100644 (file)
index d6821b6..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.request;
-
-/**
- * Builder for mode API requests
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class ModeBuilder extends TimedRequestBuilder<Mode> {
-
-    private String mode;
-    private boolean hasSetMode;
-
-    /**
-     * Creates a new mode command
-     *
-     * @return A mode command or null when the configuration is invalid
-     *
-     */
-    @Override
-    public Mode build() {
-        if (hasSetMode) {
-            if (useEndTime()) {
-                return new Mode(mode, getYear(), getMonth(), getDay());
-            } else {
-                return new Mode(mode);
-            }
-        }
-        return null;
-    }
-
-    public ModeBuilder setMode(String mode) {
-        this.hasSetMode = true;
-        this.mode = mode;
-        return this;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/RequestBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/RequestBuilder.java
deleted file mode 100644 (file)
index 301c4b8..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.request;
-
-/**
- * Builder for API requests
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public interface RequestBuilder<T> {
-
-    public T build();
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/TimedRequestBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/TimedRequestBuilder.java
deleted file mode 100644 (file)
index 8b6fa67..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.request;
-
-/**
- * Builder for timed API requests
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public abstract class TimedRequestBuilder<T> implements RequestBuilder<T> {
-    private boolean useEndTime;
-    private int year;
-    private int month;
-    private int day;
-
-    public RequestBuilder<T> withEndTime(int year, int month, int day) {
-        this.useEndTime = true;
-        this.year = year;
-        this.month = month;
-        this.day = day;
-        return this;
-    }
-
-    protected boolean useEndTime() {
-        return useEndTime;
-    }
-
-    protected int getYear() {
-        return year;
-    }
-
-    protected int getMonth() {
-        return month;
-    }
-
-    protected int getDay() {
-        return day;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ActiveFault.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ActiveFault.java
deleted file mode 100644 (file)
index ef9ede0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the active fault
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class ActiveFault {
-
-    @SerializedName("faultType")
-    private String faultType;
-
-    @SerializedName("since")
-    private String since;
-
-    public String getFaultType() {
-        return faultType;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Authentication.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Authentication.java
deleted file mode 100644 (file)
index e91e6c3..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the authentication
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class Authentication {
-
-    @SerializedName("access_token")
-    private String accessToken;
-
-    @SerializedName("token_type")
-    private String tokenType;
-
-    @SerializedName("expires_in")
-    private int expiresIn;
-
-    @SerializedName("refresh_token")
-    private String refreshToken;
-
-    @SerializedName("scope")
-    private String scope;
-
-    /** Convenience variable for current system time in seconds */
-    private long systemTime;
-
-    public String getAccessToken() {
-        return accessToken;
-    }
-
-    public int getExpiresIn() {
-        return expiresIn;
-    }
-
-    public String getRefreshToken() {
-        return refreshToken;
-    }
-
-    public void setSystemTime(long systemTime) {
-        this.systemTime = systemTime;
-    }
-
-    public long getSystemTime() {
-        return systemTime;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Gateway.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Gateway.java
deleted file mode 100644 (file)
index 057053a..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import java.util.List;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the gateway
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class Gateway {
-
-    @SerializedName("gatewayInfo")
-    private GatewayInfo gatewayInfo;
-
-    @SerializedName("temperatureControlSystems")
-    private List<TemperatureControlSystem> temperatureControlSystems;
-
-    public GatewayInfo getGatewayInfo() {
-        return gatewayInfo;
-    }
-
-    public List<TemperatureControlSystem> getTemperatureControlSystems() {
-        return temperatureControlSystems;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayInfo.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayInfo.java
deleted file mode 100644 (file)
index 586afae..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the gateway info
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class GatewayInfo {
-
-    @SerializedName("gatewayId")
-    private String gatewayId;
-
-    @SerializedName("mac")
-    private String macAddress;
-
-    @SerializedName("crc")
-    private String crc;
-
-    @SerializedName("isWiFi")
-    private boolean isWifi;
-
-    public String getGatewayId() {
-        return gatewayId;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayStatus.java
deleted file mode 100644 (file)
index 1e57385..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import java.util.List;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the gateway status
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class GatewayStatus {
-
-    @SerializedName("gatewayId")
-    private String gatewayId;
-
-    @SerializedName("temperatureControlSystems")
-    private List<TemperatureControlSystemStatus> temperatureControlSystems;
-
-    @SerializedName("activeFaults")
-    private List<ActiveFault> activeFaults;
-
-    public List<TemperatureControlSystemStatus> getTemperatureControlSystems() {
-        return temperatureControlSystems;
-    }
-
-    public boolean hasActiveFaults() {
-        return !activeFaults.isEmpty();
-    }
-
-    public ActiveFault getActiveFault(int index) {
-        return activeFaults.get(index);
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointCapabilities.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointCapabilities.java
deleted file mode 100644 (file)
index 83247db..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import java.util.List;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the heat set point capabilities
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class HeatSetpointCapabilities {
-
-    @SerializedName("maxHeatSetpoint")
-    private double maxHeatSetpoint;
-
-    @SerializedName("minHeatSetpoint")
-    private double minHeatSetpoint;
-
-    @SerializedName("valueResolution")
-    private double valueResolution;
-
-    @SerializedName("allowedSetpointModes")
-    private List<String> allowedSetpointModes;
-
-    @SerializedName("maxDuration")
-    private String maxDuration;
-
-    @SerializedName("timingResolution")
-    private String timingResolution;
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointStatus.java
deleted file mode 100644 (file)
index 99114ea..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the heat setpoint status
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class HeatSetpointStatus {
-
-    @SerializedName("targetHeatTemperature")
-    private double targetTemperature;
-
-    @SerializedName("setpointMode")
-    private String setpointMode;
-
-    public double getTargetTemperature() {
-        return targetTemperature;
-    }
-
-    public String getSetpointMode() {
-        return setpointMode;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Location.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Location.java
deleted file mode 100644 (file)
index 20dbeb9..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import java.util.List;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the location
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class Location {
-
-    @SerializedName("locationInfo")
-    private LocationInfo locationInfo;
-
-    @SerializedName("gateways")
-    private List<Gateway> gateways;
-
-    public LocationInfo getLocationInfo() {
-        return locationInfo;
-    }
-
-    public List<Gateway> getGateways() {
-        return gateways;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationInfo.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationInfo.java
deleted file mode 100644 (file)
index 40b81c1..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the location info
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class LocationInfo {
-
-    @SerializedName("locationId")
-    private String locationId;
-
-    @SerializedName("name")
-    private String name;
-
-    @SerializedName("streetAddress")
-    private String streetAddress;
-
-    @SerializedName("city")
-    private String city;
-
-    @SerializedName("country")
-    private String country;
-
-    @SerializedName("postcode")
-    private String postcode;
-
-    @SerializedName("locationType")
-    private String locationType;
-
-    @SerializedName("useDaylightSaveSwitching")
-    private boolean useDaylightSaveSwitching;
-
-    @SerializedName("timeZone")
-    private TimeZone timeZone;
-
-    @SerializedName("locationOwner")
-    private LocationOwner locationOwner;
-
-    public String getLocationId() {
-        return locationId;
-    }
-
-    public String getName() {
-        return name;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationOwner.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationOwner.java
deleted file mode 100644 (file)
index 286848a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the location owner
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class LocationOwner {
-
-    @SerializedName("userId")
-    private int userId;
-
-    @SerializedName("username")
-    private String username;
-
-    @SerializedName("firstname")
-    private String firstName;
-
-    @SerializedName("lastname")
-    private String lastName;
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationStatus.java
deleted file mode 100644 (file)
index 3446023..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the location status
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class LocationStatus {
-
-    @SerializedName("locationId")
-    private String locationId;
-
-    @SerializedName("gateways")
-    private List<GatewayStatus> gateways;
-
-    public LocationStatus() {
-        locationId = "";
-        gateways = new ArrayList<>();
-    }
-
-    public List<GatewayStatus> getGateways() {
-        return gateways;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Locations.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Locations.java
deleted file mode 100644 (file)
index d0864b4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import java.util.ArrayList;
-
-/**
- * Alias for a list of locations
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class Locations extends ArrayList<Location> {
-
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationsStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationsStatus.java
deleted file mode 100644 (file)
index 3b69564..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import java.util.ArrayList;
-
-/**
- * Alias for a list of location statuses
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class LocationsStatus extends ArrayList<LocationStatus> {
-
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Mode.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Mode.java
deleted file mode 100644 (file)
index 707b416..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the mode
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class Mode {
-
-    @SerializedName("systemMode")
-    private String systemMode;
-
-    @SerializedName("canBePermanent")
-    private boolean canBePermanent;
-
-    @SerializedName("canBeTemporary")
-    private boolean canBeTemporary;
-
-    @SerializedName("timingMode")
-    private String timingMode;
-
-    @SerializedName("maxDuration")
-    private String maxDuration;
-
-    @SerializedName("timingResolution")
-    private String timingResolution;
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ScheduleCapabilities.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ScheduleCapabilities.java
deleted file mode 100644 (file)
index e1aec29..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the schedule capabilities
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class ScheduleCapabilities {
-
-    @SerializedName("maxSwitchpointsPerDay")
-    private int maxSwitchpointsPerDay;
-
-    @SerializedName("minSwitchpointsPerDay")
-    private int minSwitchpointsPerDay;
-
-    @SerializedName("setpointValueResolution")
-    private double setpointValueResolution;
-
-    @SerializedName("timingResolution")
-    private String timingResolution;
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/SystemModeStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/SystemModeStatus.java
deleted file mode 100644 (file)
index ce2af90..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the system mode status
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class SystemModeStatus {
-
-    @SerializedName("mode")
-    private String mode;
-
-    @SerializedName("isPermanent")
-    private boolean isPermanent;
-
-    public String getMode() {
-        return mode;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystem.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystem.java
deleted file mode 100644 (file)
index b5c8d8a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import java.util.List;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the temperature control system
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class TemperatureControlSystem {
-
-    @SerializedName("systemId")
-    private String systemId;
-
-    @SerializedName("modelType")
-    private String modelType;
-
-    @SerializedName("zones")
-    private List<Zone> zones;
-
-    @SerializedName("allowedSystemModes")
-    private List<Mode> allowedSystemModes;
-
-    public String getSystemId() {
-        return systemId;
-    }
-
-    public List<Zone> getZones() {
-        return zones;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystemStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystemStatus.java
deleted file mode 100644 (file)
index 019e6ec..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import java.util.List;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the temperature control system status
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class TemperatureControlSystemStatus {
-
-    @SerializedName("systemId")
-    private String systemId;
-
-    @SerializedName("systemModeStatus")
-    private SystemModeStatus mode;
-
-    @SerializedName("zones")
-    private List<ZoneStatus> zones;
-
-    @SerializedName("activeFaults")
-    private List<ActiveFault> activeFaults;
-
-    public String getSystemId() {
-        return systemId;
-    }
-
-    public SystemModeStatus getMode() {
-        return mode;
-    }
-
-    public List<ZoneStatus> getZones() {
-        return zones;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureStatus.java
deleted file mode 100644 (file)
index c0374cf..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the temperature status
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class TemperatureStatus {
-
-    @SerializedName("temperature")
-    private double temperature;
-
-    @SerializedName("isAvailable")
-    private boolean isAvailable;
-
-    public double getTemperature() {
-        return temperature;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TimeZone.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TimeZone.java
deleted file mode 100644 (file)
index eef0cff..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the time zone
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class TimeZone {
-
-    @SerializedName("timeZoneId")
-    private String timeZoneId;
-
-    @SerializedName("displayName")
-    private String displayName;
-
-    @SerializedName("offsetMinutes")
-    private int offsetMinutes;
-
-    @SerializedName("currentOffsetMinutes")
-    private int currentOffsetMinutes;
-
-    @SerializedName("supportsDaylightSaving")
-    private boolean supportsDaylightSaving;
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/UserAccount.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/UserAccount.java
deleted file mode 100644 (file)
index 6967cf9..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the user account
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class UserAccount {
-
-    @SerializedName("userId")
-    private String userId;
-
-    @SerializedName("username")
-    private String userName;
-
-    @SerializedName("firstname")
-    private String firstName;
-
-    @SerializedName("lastname")
-    private String lastName;
-
-    @SerializedName("streetAddress")
-    private String streetAddress;
-
-    @SerializedName("city")
-    private String city;
-
-    @SerializedName("postcode")
-    private String postCode;
-
-    @SerializedName("country")
-    private String country;
-
-    @SerializedName("language")
-    private String language;
-
-    public String getUserId() {
-        return userId;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Zone.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Zone.java
deleted file mode 100644 (file)
index 726c988..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for the zone
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class Zone {
-
-    @SerializedName("zoneId")
-    private String zoneId;
-
-    @SerializedName("modelType")
-    private String modelType;
-
-    @SerializedName("name")
-    private String name;
-
-    @SerializedName("zoneType")
-    private String zoneType;
-
-    @SerializedName("heatSetpointCapabilities")
-    private HeatSetpointCapabilities heatSetpointCapabilities;
-
-    @SerializedName("scheduleCapabilities")
-    private ScheduleCapabilities scheduleCapabilities;
-
-    public String getZoneId() {
-        return zoneId;
-    }
-
-    public String getName() {
-        return name;
-    }
-}
diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ZoneStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ZoneStatus.java
deleted file mode 100644 (file)
index 3a063ce..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Copyright (c) 2010-2023 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.evohome.internal.api.models.v2.response;
-
-import java.util.List;
-
-import com.google.gson.annotations.SerializedName;
-
-/**
- * Response model for zone status
- *
- * @author Jasper van Zuijlen - Initial contribution
- *
- */
-public class ZoneStatus {
-
-    @SerializedName("zoneId")
-    private String zoneId;
-
-    @SerializedName("name")
-    private String name;
-
-    @SerializedName("temperatureStatus")
-    private TemperatureStatus temperature;
-
-    @SerializedName("setpointStatus")
-    private HeatSetpointStatus heatSetpoint;
-
-    @SerializedName("activeFaults")
-    private List<ActiveFault> activeFaults;
-
-    public String getZoneId() {
-        return zoneId;
-    }
-
-    public TemperatureStatus getTemperature() {
-        return temperature;
-    }
-
-    public HeatSetpointStatus getHeatSetpoint() {
-        return heatSetpoint;
-    }
-
-    public boolean hasActiveFaults() {
-        return !activeFaults.isEmpty();
-    }
-
-    public ActiveFault getActiveFault(int index) {
-        return activeFaults.get(index);
-    }
-}
index 2fd30a516e01b0712fd4f345338ea7378398912e..ce750c26c9a4873aab8a460908ba34c8a08b2e81 100644 (file)
  */
 package org.openhab.binding.evohome.internal.configuration;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
 /**
  * Contains the configuration of the binding.
  *
  * @author Jasper van Zuijlen - Initial contribution
  *
  */
+@NonNullByDefault
 public class EvohomeAccountConfiguration {
-    public String username;
-    public String password;
-    public String applicationId;
+    public String username = "";
+    public String password = "";
+    public String applicationId = "";
     public int refreshInterval;
 }
index af56d9f0f5d1c4de8dd4414dffea97a63a379c1f..2c8727f991116c398080c0980cd31452bff26669 100644 (file)
  */
 package org.openhab.binding.evohome.internal.configuration;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
 /**
  * Contains the configuration of the binding.
  *
  * @author Jasper van Zuijlen - Initial contribution
  *
  */
+@NonNullByDefault
 public class EvohomeTemperatureControlSystemConfiguration {
-    public String id;
-    public String name;
+    public String id = "";
+    public String name = "";
 }
index 961bed76bcb908639a9ccc2776c12ea9ccbe9bfe..42b7949981d6f9fb64bcf03f7f1a0db63abeedb4 100644 (file)
  */
 package org.openhab.binding.evohome.internal.configuration;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
 /**
  * Contains the common configuration definition of an evohome Thing
  *
  * @author Jasper van Zuijlen - Initial contribution
  *
  */
+@NonNullByDefault
 public class EvohomeThingConfiguration {
-    public String id;
-    public String name;
+    public String id = "";
+    public String name = "";
 }
index cf9cd92216d06c5c4d56807e377fc53d691e4e75..f5b197e6908dbf2a4570a5e75768e25eade74608 100644 (file)
@@ -15,11 +15,13 @@ package org.openhab.binding.evohome.internal.discovery;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.openhab.binding.evohome.internal.EvohomeBindingConstants;
-import org.openhab.binding.evohome.internal.api.models.v2.response.Gateway;
-import org.openhab.binding.evohome.internal.api.models.v2.response.Location;
-import org.openhab.binding.evohome.internal.api.models.v2.response.TemperatureControlSystem;
-import org.openhab.binding.evohome.internal.api.models.v2.response.Zone;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Gateway;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Location;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Locations;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.TemperatureControlSystem;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Zone;
 import org.openhab.binding.evohome.internal.handler.AccountStatusListener;
 import org.openhab.binding.evohome.internal.handler.EvohomeAccountBridgeHandler;
 import org.openhab.core.config.discovery.AbstractDiscoveryService;
@@ -37,6 +39,7 @@ import org.slf4j.LoggerFactory;
  * @author Jasper van Zuijlen - Background discovery
  *
  */
+@NonNullByDefault
 public class EvohomeDiscoveryService extends AbstractDiscoveryService implements AccountStatusListener {
     private final Logger logger = LoggerFactory.getLogger(EvohomeDiscoveryService.class);
     private static final int TIMEOUT = 5;
@@ -86,18 +89,29 @@ public class EvohomeDiscoveryService extends AbstractDiscoveryService implements
             logger.debug("Evohome Gateway not online, scanning postponed");
             return;
         }
+        Locations localEvohomeConfig = bridge.getEvohomeConfig();
 
-        for (Location location : bridge.getEvohomeConfig()) {
+        if (localEvohomeConfig == null) {
+            return;
+        }
+        for (Location location : localEvohomeConfig) {
+            if (location == null) {
+                continue;
+            }
             for (Gateway gateway : location.getGateways()) {
                 for (TemperatureControlSystem tcs : gateway.getTemperatureControlSystems()) {
+                    if (tcs == null) {
+                        continue;
+                    }
                     addDisplayDiscoveryResult(location, tcs);
                     for (Zone zone : tcs.getZones()) {
-                        addZoneDiscoveryResult(location, zone);
+                        if (zone != null) {
+                            addZoneDiscoveryResult(location, zone);
+                        }
                     }
                 }
             }
         }
-
         stopScan();
     }
 
index 7253312601bef4e0a33905780d4d7583697f4df3..4341688a7b99be423ed17d968f30b02f6b1ed034 100644 (file)
@@ -12,6 +12,7 @@
  */
 package org.openhab.binding.evohome.internal.handler;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.openhab.core.thing.ThingStatus;
 
 /**
@@ -20,6 +21,7 @@ import org.openhab.core.thing.ThingStatus;
  * @author Jasper van Zuijlen - Initial contribution
  *
  */
+@NonNullByDefault
 public interface AccountStatusListener {
 
     /**
index ac5ad2378fb004876c36a8e9cff502c7511ead60..11048291cde0e9c9c2c8cb206dd518fd15783e04 100644 (file)
@@ -12,7 +12,9 @@
  */
 package org.openhab.binding.evohome.internal.handler;
 
-import org.openhab.binding.evohome.internal.api.models.v2.response.Locations;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Locations;
 import org.openhab.binding.evohome.internal.configuration.EvohomeThingConfiguration;
 import org.openhab.core.thing.Bridge;
 import org.openhab.core.thing.Thing;
@@ -25,8 +27,9 @@ import org.openhab.core.thing.binding.BaseThingHandler;
  *
  * @author Jasper van Zuijlen - Initial contribution
  */
+@NonNullByDefault
 public abstract class BaseEvohomeHandler extends BaseThingHandler {
-    private EvohomeThingConfiguration configuration;
+    private EvohomeThingConfiguration configuration = new EvohomeThingConfiguration();
 
     public BaseEvohomeHandler(Thing thing) {
         super(thing);
@@ -40,14 +43,10 @@ public abstract class BaseEvohomeHandler extends BaseThingHandler {
 
     @Override
     public void dispose() {
-        configuration = null;
     }
 
     public String getId() {
-        if (configuration != null) {
-            return configuration.id;
-        }
-        return null;
+        return configuration.id;
     }
 
     /**
@@ -64,7 +63,7 @@ public abstract class BaseEvohomeHandler extends BaseThingHandler {
      *
      * @return The evohome brdige
      */
-    protected EvohomeAccountBridgeHandler getEvohomeBridge() {
+    protected @Nullable EvohomeAccountBridgeHandler getEvohomeBridge() {
         Bridge bridge = getBridge();
         if (bridge != null) {
             return (EvohomeAccountBridgeHandler) bridge.getHandler();
@@ -78,10 +77,10 @@ public abstract class BaseEvohomeHandler extends BaseThingHandler {
      *
      * @return The current evohome configuration
      */
-    protected Locations getEvohomeConfig() {
-        EvohomeAccountBridgeHandler bridge = getEvohomeBridge();
-        if (bridge != null) {
-            return bridge.getEvohomeConfig();
+    protected @Nullable Locations getEvohomeConfig() {
+        EvohomeAccountBridgeHandler bridgeAccountHandler = getEvohomeBridge();
+        if (bridgeAccountHandler != null) {
+            return bridgeAccountHandler.getEvohomeConfig();
         }
 
         return null;
@@ -115,7 +114,7 @@ public abstract class BaseEvohomeHandler extends BaseThingHandler {
      * @param detail The status detail value
      * @param message The message to show with the status
      */
-    protected void updateEvohomeThingStatus(ThingStatus newStatus, ThingStatusDetail detail, String message) {
+    protected void updateEvohomeThingStatus(ThingStatus newStatus, ThingStatusDetail detail, @Nullable String message) {
         // Prevent spamming the log file
         if (!newStatus.equals(getThing().getStatus())) {
             updateStatus(newStatus, detail, message);
@@ -128,10 +127,7 @@ public abstract class BaseEvohomeHandler extends BaseThingHandler {
      * @param configuration The configuration to check
      */
     private void checkConfig() {
-        if (configuration == null) {
-            updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
-                    "Configuration is missing or corrupted");
-        } else if (configuration.id == null || configuration.id.isEmpty()) {
+        if (configuration.id.isEmpty()) {
             updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Id not configured");
         }
     }
index 22054a4e2a58f6cf76b693aab7a84df48e6d6ce4..e472ce968065c56cf0b0740b067d9d216b2cc21c 100644 (file)
@@ -22,19 +22,21 @@ import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.jetty.client.HttpClient;
 import org.openhab.binding.evohome.internal.RunnableWithTimeout;
 import org.openhab.binding.evohome.internal.api.EvohomeApiClient;
-import org.openhab.binding.evohome.internal.api.models.v2.response.Gateway;
-import org.openhab.binding.evohome.internal.api.models.v2.response.GatewayStatus;
-import org.openhab.binding.evohome.internal.api.models.v2.response.Location;
-import org.openhab.binding.evohome.internal.api.models.v2.response.LocationStatus;
-import org.openhab.binding.evohome.internal.api.models.v2.response.Locations;
-import org.openhab.binding.evohome.internal.api.models.v2.response.LocationsStatus;
-import org.openhab.binding.evohome.internal.api.models.v2.response.TemperatureControlSystem;
-import org.openhab.binding.evohome.internal.api.models.v2.response.TemperatureControlSystemStatus;
-import org.openhab.binding.evohome.internal.api.models.v2.response.Zone;
-import org.openhab.binding.evohome.internal.api.models.v2.response.ZoneStatus;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Gateway;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.GatewayStatus;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Location;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.LocationStatus;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Locations;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.LocationsStatus;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.TemperatureControlSystem;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.TemperatureControlSystemStatus;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.Zone;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.ZoneStatus;
 import org.openhab.binding.evohome.internal.configuration.EvohomeAccountConfiguration;
 import org.openhab.core.thing.Bridge;
 import org.openhab.core.thing.ChannelUID;
@@ -54,15 +56,16 @@ import org.slf4j.LoggerFactory;
  * @author Jasper van Zuijlen - Initial contribution
  *
  */
+@NonNullByDefault
 public class EvohomeAccountBridgeHandler extends BaseBridgeHandler {
 
     private final Logger logger = LoggerFactory.getLogger(EvohomeAccountBridgeHandler.class);
     private final HttpClient httpClient;
-    private EvohomeAccountConfiguration configuration;
-    private EvohomeApiClient apiClient;
+    private EvohomeAccountConfiguration configuration = new EvohomeAccountConfiguration();
+    private @Nullable EvohomeApiClient apiClient;
     private List<AccountStatusListener> listeners = new CopyOnWriteArrayList<>();
 
-    protected ScheduledFuture<?> refreshTask;
+    protected @Nullable ScheduledFuture<?> refreshTask;
 
     public EvohomeAccountBridgeHandler(Bridge thing, HttpClient httpClient) {
         super(thing);
@@ -73,13 +76,14 @@ public class EvohomeAccountBridgeHandler extends BaseBridgeHandler {
     public void initialize() {
         configuration = getConfigAs(EvohomeAccountConfiguration.class);
 
-        if (checkConfig()) {
+        if (checkConfig(configuration)) {
             apiClient = new EvohomeApiClient(configuration, this.httpClient);
 
             // Initialization can take a while, so kick it off on a separate thread
             scheduler.schedule(() -> {
-                if (apiClient.login()) {
-                    if (checkInstallationInfoHasDuplicateIds(apiClient.getInstallationInfo())) {
+                EvohomeApiClient localApiCLient = apiClient;
+                if (localApiCLient != null && localApiCLient.login()) {
+                    if (checkInstallationInfoHasDuplicateIds(localApiCLient.getInstallationInfo())) {
                         startRefreshTask();
                     } else {
                         updateAccountStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
@@ -104,24 +108,41 @@ public class EvohomeAccountBridgeHandler extends BaseBridgeHandler {
     public void handleCommand(ChannelUID channelUID, Command command) {
     }
 
-    public Locations getEvohomeConfig() {
-        return apiClient.getInstallationInfo();
+    public @Nullable Locations getEvohomeConfig() {
+        EvohomeApiClient localApiCLient = apiClient;
+        if (localApiCLient != null) {
+            return localApiCLient.getInstallationInfo();
+        }
+        return null;
     }
 
-    public LocationsStatus getEvohomeStatus() {
-        return apiClient.getInstallationStatus();
+    public @Nullable LocationsStatus getEvohomeStatus() {
+        EvohomeApiClient localApiCLient = apiClient;
+        if (localApiCLient != null) {
+            return localApiCLient.getInstallationStatus();
+        }
+        return null;
     }
 
     public void setTcsMode(String tcsId, String mode) {
-        tryToCall(() -> apiClient.setTcsMode(tcsId, mode));
+        EvohomeApiClient localApiCLient = apiClient;
+        if (localApiCLient != null) {
+            tryToCall(() -> localApiCLient.setTcsMode(tcsId, mode));
+        }
     }
 
     public void setPermanentSetPoint(String zoneId, double doubleValue) {
-        tryToCall(() -> apiClient.setHeatingZoneOverride(zoneId, doubleValue));
+        EvohomeApiClient localApiCLient = apiClient;
+        if (localApiCLient != null) {
+            tryToCall(() -> localApiCLient.setHeatingZoneOverride(zoneId, doubleValue));
+        }
     }
 
     public void cancelSetPointOverride(String zoneId) {
-        tryToCall(() -> apiClient.cancelHeatingZoneOverride(zoneId));
+        EvohomeApiClient localApiCLient = apiClient;
+        if (localApiCLient != null) {
+            tryToCall(() -> localApiCLient.cancelHeatingZoneOverride(zoneId));
+        }
     }
 
     public void addAccountStatusListener(AccountStatusListener listener) {
@@ -164,26 +185,27 @@ public class EvohomeAccountBridgeHandler extends BaseBridgeHandler {
     }
 
     private void disposeApiClient() {
-        if (apiClient != null) {
-            apiClient.logout();
+        EvohomeApiClient localApiClient = apiClient;
+        if (localApiClient != null) {
+            localApiClient.logout();
+            this.apiClient = null;
         }
-        apiClient = null;
     }
 
     private void disposeRefreshTask() {
-        if (refreshTask != null) {
-            refreshTask.cancel(true);
+        ScheduledFuture<?> localRefreshTask = refreshTask;
+        if (localRefreshTask != null) {
+            localRefreshTask.cancel(true);
+            this.refreshTask = null;
         }
     }
 
-    private boolean checkConfig() {
+    private boolean checkConfig(EvohomeAccountConfiguration configuration) {
         String errorMessage = "";
 
-        if (configuration == null) {
-            errorMessage = "Configuration is missing or corrupted";
-        } else if (configuration.username == null || configuration.username.isEmpty()) {
+        if (configuration.username.isBlank()) {
             errorMessage = "Username not configured";
-        } else if (configuration.password == null || configuration.password.isEmpty()) {
+        } else if (configuration.password.isBlank()) {
             errorMessage = "Password not configured";
         } else {
             return true;
@@ -202,7 +224,10 @@ public class EvohomeAccountBridgeHandler extends BaseBridgeHandler {
 
     private void update() {
         try {
-            apiClient.update();
+            EvohomeApiClient localApiCLient = apiClient;
+            if (localApiCLient != null) {
+                localApiCLient.update();
+            }
             updateAccountStatus(ThingStatus.ONLINE);
             updateThings();
         } catch (Exception e) {
@@ -215,7 +240,7 @@ public class EvohomeAccountBridgeHandler extends BaseBridgeHandler {
         updateAccountStatus(newStatus, ThingStatusDetail.NONE, null);
     }
 
-    private void updateAccountStatus(ThingStatus newStatus, ThingStatusDetail detail, String message) {
+    private void updateAccountStatus(ThingStatus newStatus, ThingStatusDetail detail, @Nullable String message) {
         // Prevent spamming the log file
         if (!newStatus.equals(getThing().getStatus())) {
             updateStatus(newStatus, detail, message);
@@ -236,15 +261,32 @@ public class EvohomeAccountBridgeHandler extends BaseBridgeHandler {
         Map<String, String> zoneIdToTcsIdMap = new HashMap<>();
         Map<String, ThingStatus> idToTcsThingsStatusMap = new HashMap<>();
 
-        // First, create a lookup table
-        for (LocationStatus location : apiClient.getInstallationStatus()) {
-            for (GatewayStatus gateway : location.getGateways()) {
-                for (TemperatureControlSystemStatus tcs : gateway.getTemperatureControlSystems()) {
-                    idToTcsMap.put(tcs.getSystemId(), tcs);
-                    tcsIdToGatewayMap.put(tcs.getSystemId(), gateway);
-                    for (ZoneStatus zone : tcs.getZones()) {
-                        idToZoneMap.put(zone.getZoneId(), zone);
-                        zoneIdToTcsIdMap.put(zone.getZoneId(), tcs.getSystemId());
+        EvohomeApiClient localApiClient = apiClient;
+        if (localApiClient != null) {
+            // First, create a lookup table
+            LocationsStatus localLocationsStatus = localApiClient.getInstallationStatus();
+            if (localLocationsStatus != null) {
+                for (LocationStatus location : localLocationsStatus) {
+                    for (GatewayStatus gateway : location.getGateways()) {
+                        if (gateway == null) {
+                            continue;
+                        }
+                        for (TemperatureControlSystemStatus tcs : gateway.getTemperatureControlSystems()) {
+                            String systemId = tcs.getSystemId();
+                            if (systemId != null) {
+                                idToTcsMap.put(systemId, tcs);
+                                tcsIdToGatewayMap.put(systemId, gateway);
+                            }
+                            for (ZoneStatus zone : tcs.getZones()) {
+                                String zoneId = zone.getZoneId();
+                                if (zoneId != null) {
+                                    idToZoneMap.put(zoneId, zone);
+                                    if (systemId != null) {
+                                        zoneIdToTcsIdMap.put(zoneId, systemId);
+                                    }
+                                }
+                            }
+                        }
                     }
                 }
             }
index 1fb6d43456ccb0d61842481358649b82bb4102e3..8dc6cbb3915ce3ce8f4b2f4a64c5c3bf0f2fe738 100644 (file)
  */
 package org.openhab.binding.evohome.internal.handler;
 
+import javax.measure.quantity.Temperature;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 import org.openhab.binding.evohome.internal.EvohomeBindingConstants;
-import org.openhab.binding.evohome.internal.api.models.v2.response.ZoneStatus;
-import org.openhab.core.library.types.DecimalType;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.ZoneStatus;
+import org.openhab.core.library.types.QuantityType;
 import org.openhab.core.library.types.StringType;
+import org.openhab.core.library.unit.SIUnits;
 import org.openhab.core.thing.ChannelUID;
 import org.openhab.core.thing.Thing;
 import org.openhab.core.thing.ThingStatus;
@@ -30,12 +35,14 @@ import org.openhab.core.types.RefreshType;
  * @author Jasper van Zuijlen - Initial contribution
  * @author Neil Renaud - Working implementation
  * @author Jasper van Zuijlen - Refactor + Permanent Zone temperature setting
+ * @author Leo Siepel - Add UoM
  */
+@NonNullByDefault
 public class EvohomeHeatingZoneHandler extends BaseEvohomeHandler {
 
     private static final int CANCEL_SET_POINT_OVERRIDE = 0;
-    private ThingStatus tcsStatus;
-    private ZoneStatus zoneStatus;
+    private @Nullable ThingStatus tcsStatus;
+    private @Nullable ZoneStatus zoneStatus;
 
     public EvohomeHeatingZoneHandler(Thing thing) {
         super(thing);
@@ -46,7 +53,7 @@ public class EvohomeHeatingZoneHandler extends BaseEvohomeHandler {
         super.initialize();
     }
 
-    public void update(ThingStatus tcsStatus, ZoneStatus zoneStatus) {
+    public void update(@Nullable ThingStatus tcsStatus, @Nullable ZoneStatus zoneStatus) {
         this.tcsStatus = tcsStatus;
         this.zoneStatus = zoneStatus;
 
@@ -62,11 +69,11 @@ public class EvohomeHeatingZoneHandler extends BaseEvohomeHandler {
             updateEvohomeThingStatus(ThingStatus.ONLINE);
 
             updateState(EvohomeBindingConstants.ZONE_TEMPERATURE_CHANNEL,
-                    new DecimalType(zoneStatus.getTemperature().getTemperature()));
+                    new QuantityType<Temperature>(zoneStatus.getTemperature().getTemperature(), SIUnits.CELSIUS));
             updateState(EvohomeBindingConstants.ZONE_SET_POINT_STATUS_CHANNEL,
                     new StringType(zoneStatus.getHeatSetpoint().getSetpointMode()));
-            updateState(EvohomeBindingConstants.ZONE_SET_POINT_CHANNEL,
-                    new DecimalType(zoneStatus.getHeatSetpoint().getTargetTemperature()));
+            updateState(EvohomeBindingConstants.ZONE_SET_POINT_CHANNEL, new QuantityType<Temperature>(
+                    zoneStatus.getHeatSetpoint().getTargetTemperature(), SIUnits.CELSIUS));
         }
     }
 
@@ -78,16 +85,19 @@ public class EvohomeHeatingZoneHandler extends BaseEvohomeHandler {
             EvohomeAccountBridgeHandler bridge = getEvohomeBridge();
             if (bridge != null) {
                 String channelId = channelUID.getId();
-                if (EvohomeBindingConstants.ZONE_SET_POINT_CHANNEL.equals(channelId)
-                        && command instanceof DecimalType) {
-                    double newTemp = ((DecimalType) command).doubleValue();
-                    if (newTemp == CANCEL_SET_POINT_OVERRIDE) {
-                        bridge.cancelSetPointOverride(getEvohomeThingConfig().id);
-                    } else if (newTemp < 5) {
-                        newTemp = 5;
-                    }
-                    if (newTemp >= 5 && newTemp <= 35) {
-                        bridge.setPermanentSetPoint(getEvohomeThingConfig().id, newTemp);
+                if (EvohomeBindingConstants.ZONE_SET_POINT_CHANNEL.equals(channelId)) {
+                    if (command instanceof QuantityType) {
+                        QuantityType<?> state = ((QuantityType<?>) command).toUnit(SIUnits.CELSIUS);
+                        double newTempInCelsius = state.doubleValue();
+
+                        if (newTempInCelsius == CANCEL_SET_POINT_OVERRIDE) {
+                            bridge.cancelSetPointOverride(getEvohomeThingConfig().id);
+                        } else if (newTempInCelsius < 5) {
+                            newTempInCelsius = 5;
+                        }
+                        if (newTempInCelsius >= 5 && newTempInCelsius <= 35) {
+                            bridge.setPermanentSetPoint(getEvohomeThingConfig().id, newTempInCelsius);
+                        }
                     }
                 }
             }
index 6781e22b3548eabcfa1074e6a2c969f3d3054d36..5d07539cd8d41a8dc468e414d2d766d1394a08e8 100644 (file)
  */
 package org.openhab.binding.evohome.internal.handler;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 import org.openhab.binding.evohome.internal.EvohomeBindingConstants;
-import org.openhab.binding.evohome.internal.api.models.v2.response.GatewayStatus;
-import org.openhab.binding.evohome.internal.api.models.v2.response.TemperatureControlSystemStatus;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.GatewayStatus;
+import org.openhab.binding.evohome.internal.api.models.v2.dto.response.TemperatureControlSystemStatus;
 import org.openhab.core.library.types.StringType;
 import org.openhab.core.thing.ChannelUID;
 import org.openhab.core.thing.Thing;
@@ -29,9 +31,10 @@ import org.openhab.core.types.RefreshType;
  * @author Jasper van Zuijlen - Initial contribution
  *
  */
+@NonNullByDefault
 public class EvohomeTemperatureControlSystemHandler extends BaseEvohomeHandler {
-    private GatewayStatus gatewayStatus;
-    private TemperatureControlSystemStatus tcsStatus;
+    private @Nullable GatewayStatus gatewayStatus;
+    private @Nullable TemperatureControlSystemStatus tcsStatus;
 
     public EvohomeTemperatureControlSystemHandler(Thing thing) {
         super(thing);
@@ -42,7 +45,7 @@ public class EvohomeTemperatureControlSystemHandler extends BaseEvohomeHandler {
         super.initialize();
     }
 
-    public void update(GatewayStatus gatewayStatus, TemperatureControlSystemStatus tcsStatus) {
+    public void update(@Nullable GatewayStatus gatewayStatus, @Nullable TemperatureControlSystemStatus tcsStatus) {
         this.gatewayStatus = gatewayStatus;
         this.tcsStatus = tcsStatus;
 
index c7b8c7e2538f345ec39c7ade4fd1b38bea741b62..0d8978b5ffeee685cb0308edb6505abbcab5fca3 100644 (file)
                </state>
        </channel-type>
        <channel-type id="temperature">
-               <item-type>Number</item-type>
+               <item-type>Number:Temperature</item-type>
                <label>Temperature</label>
                <description>Current zone temperature</description>
                <category>temperature</category>
-               <state readOnly="true" pattern="%.1f °C">
+               <tags>
+                       <tag>Measurement</tag>
+                       <tag>Temperature</tag>
+               </tags>
+               <state readOnly="true" pattern="%.1f %unit%">
                </state>
        </channel-type>
        <channel-type id="setpoint">
-               <item-type>Number</item-type>
+               <item-type>Number:Temperature</item-type>
                <label>Set Point</label>
                <description>Gets or sets the set point of this zone (0 cancels the override).</description>
                <category>heating</category>
-               <state min="0.0" max="35.0" step="0.5" pattern="%.1f °C"/>
+               <tags>
+                       <tag>Setpoint</tag>
+                       <tag>Temperature</tag>
+               </tags>
+               <state min="0.0" max="35.0" step="0.5" pattern="%.1f %unit%"/>
        </channel-type>
        <channel-type id="setpointstatus">
                <item-type>String</item-type>