]> git.basschouten.com Git - openhab-addons.git/blob
6aa4a143fb1d8e1b4dae7aabc4410cd033ace1bf
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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.amazonechocontrol.internal.jsons;
14
15 import java.util.Arrays;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.binding.amazonechocontrol.internal.jsons.JsonSmartHomeCapabilities.SmartHomeCapability;
20 import org.openhab.binding.amazonechocontrol.internal.jsons.JsonSmartHomeDeviceNetworkState.SmartHomeDeviceNetworkState;
21 import org.openhab.binding.amazonechocontrol.internal.jsons.JsonSmartHomeTags.JsonSmartHomeTag;
22
23 /**
24  * @author Lukas Knoeller - Initial contribution
25  */
26 @NonNullByDefault
27 public class JsonSmartHomeDevices {
28     public static class SmartHomeDevice implements SmartHomeBaseDevice {
29         public @Nullable Integer updateIntervalInSeconds;
30
31         @Override
32         public @Nullable String findId() {
33             return applianceId;
34         }
35
36         @Override
37         public boolean isGroup() {
38             return false;
39         }
40
41         public @Nullable String applianceId;
42         public @Nullable String manufacturerName;
43         public @Nullable String friendlyDescription;
44         public @Nullable String modelName;
45         public @Nullable String friendlyName;
46         public @Nullable String reachability;
47         public @Nullable String entityId;
48         public @Nullable SmartHomeDeviceNetworkState applianceNetworkState;
49         public @Nullable SmartHomeCapability @Nullable [] capabilities;
50         public @Nullable JsonSmartHomeTag tags;
51         public @Nullable String @Nullable [] applianceTypes;
52         public @Nullable JsonSmartHomeDeviceAlias @Nullable [] aliases;
53         public @Nullable SmartHomeDevice @Nullable [] groupDevices;
54         public @Nullable String connectedVia;
55         public @Nullable DriverIdentity driverIdentity;
56
57         @Override
58         public String toString() {
59             return "SmartHomeDevice{" + "updateIntervalInSeconds=" + updateIntervalInSeconds + ", applianceId='"
60                     + applianceId + '\'' + ", manufacturerName='" + manufacturerName + '\'' + ", friendlyDescription='"
61                     + friendlyDescription + '\'' + ", modelName='" + modelName + '\'' + ", friendlyName='"
62                     + friendlyName + '\'' + ", reachability='" + reachability + '\'' + ", entityId='" + entityId + '\''
63                     + ", applianceNetworkState=" + applianceNetworkState + ", capabilities="
64                     + Arrays.toString(capabilities) + ", tags=" + tags + ", applianceTypes="
65                     + Arrays.toString(applianceTypes) + ", aliases=" + Arrays.toString(aliases) + ", groupDevices="
66                     + Arrays.toString(groupDevices) + ", connectedVia='" + connectedVia + '\'' + ", driverIdentity="
67                     + driverIdentity + '}';
68         }
69     }
70
71     public static class DriverIdentity {
72         public @Nullable String namespace;
73         public @Nullable String identifier;
74
75         @Override
76         public String toString() {
77             return "DriverIdentity{" + "namespace='" + namespace + '\'' + ", identifier='" + identifier + '\'' + '}';
78         }
79     }
80
81     public @Nullable SmartHomeDevice @Nullable [] smarthomeDevices;
82 }