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