]> git.basschouten.com Git - openhab-addons.git/blob
f36dffc0ec316069b0448ffd954947f063cad6a5
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.intesis.internal.gson;
14
15 import com.google.gson.JsonArray;
16 import com.google.gson.JsonElement;
17
18 /**
19  * {@link IntesisHomeJSonDTO} is used for the JSon/GSon mapping
20  *
21  * @author Hans-Jörg Merk - Initial contribution
22  */
23 public class IntesisHomeJSonDTO {
24
25     public static class Response {
26         public boolean success;
27         public JsonElement data;
28     }
29
30     public static class Data {
31         public JsonElement id;
32         public JsonElement info;
33         public JsonElement userinfo;
34         public JsonElement config;
35         public JsonElement dp;
36         public JsonElement dpval;
37     }
38
39     public static class Id {
40         public String sessionID; // Session ID
41     }
42
43     // Device Information used for thing properties
44     public static class Info {
45         public String wlanSTAMAC; // Device Client MAC Address
46         public String wlanAPMAC; // Device Access Point MAC Address
47         public String fwVersion; // Device Firmware Version
48         public String wlanFwVersion; // Wireless Firmware Version
49         public String acStatus; // Air Conditioner Communication Status
50         public String wlanLNK; // Connection Status with Wireless Network
51         public String ssid; // Wireless Network SSID
52         public String rssi; // Wireless Signal Strength
53         public String tcpServerLNK; // Cloud Server Connection (Not used for communication here)
54         public String localdatetime; // Local Date Time
55         public String powerStatus;
56         public String lastconfigdatetime; // Last Configuration Date Time
57         public String deviceModel; // Device Model
58         public String sn; // Serial Number
59         public String lastError;
60     }
61
62     public static class Userinfo {
63         public String username;
64         public JsonElement servicelist;
65     }
66
67     // List of available services
68     public static class Servicelist {
69         public String setconfig;
70         public String getconfig;
71         public String getcurrentconfig;
72         public String getinfo;
73         public String login;
74         public String logout;
75         public String passchange;
76         public String getavailabledatapoints;
77         public String setdatapointvalue;
78         public String getdatapointvalue;
79         public String getavailableservices;
80         public String reboot;
81         public String setdefaults;
82         public String getdefaultconfig;
83     }
84
85     public static class Config {
86         public String deviceModel; // Device Model
87         public String ip; // Device IP Address
88         public String netmask; // Device IP Address
89         public String dfltgw; // Default gateway
90         public boolean dhcp; // DHCP enabled
91         public String ssid; // WLAN Access Point
92         public int security; // Security Type
93         public int regdomain;
94         public int lastconfigdatetime;
95     }
96
97     public static class Dp {
98         public JsonArray datapoints; // dataPoints
99     }
100
101     // Array of UIDs with corresponding description for dynamic channel creation
102     public static class Datapoints {
103         public int uid; // dataPoint
104         public String rw; // read/write status
105         public int type;
106         public JsonElement descr;
107     }
108
109     // Descriptor of dataPoint values
110     public static class Descr {
111         public int numStates;
112         public String[] states;
113         public String maxValue;
114         public String minValue;
115     }
116
117     // Array of UIDs with corresponding values, mapped into channel
118     public static class Dpval {
119         public int uid; // ID
120         public int value;
121         public int status;
122     }
123 }