2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.amazonechocontrol.internal.jsons;
15 import java.util.List;
16 import java.util.Objects;
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;
25 * @author Lukas Knoeller - Initial contribution
28 public class JsonSmartHomeDevices {
29 public static class SmartHomeDevice implements SmartHomeBaseDevice {
30 public @Nullable Integer updateIntervalInSeconds;
31 public @Nullable String applianceId;
32 public @Nullable String manufacturerName;
33 public @Nullable String friendlyDescription;
34 public @Nullable String modelName;
35 public @Nullable String friendlyName;
36 public @Nullable String reachability;
37 public @Nullable String entityId;
38 public @Nullable SmartHomeDeviceNetworkState applianceNetworkState;
39 public @Nullable List<SmartHomeCapability> capabilities;
40 public @Nullable JsonSmartHomeTag tags;
41 public @Nullable List<String> applianceTypes;
42 public @Nullable List<JsonSmartHomeDeviceAlias> aliases;
43 public @Nullable List<SmartHomeDevice> groupDevices;
44 public @Nullable String connectedVia;
45 public @Nullable DriverIdentity driverIdentity;
46 public @Nullable List<String> mergedApplianceIds;
47 public @Nullable List<SmartHomeDevice> smarthomeDevices;
49 public List<SmartHomeCapability> getCapabilities() {
50 return Objects.requireNonNullElse(capabilities, List.of());
54 public @Nullable String findId() {
59 public @Nullable String findEntityId() {
64 public boolean isGroup() {
69 public String toString() {
70 return "SmartHomeDevice{" + "updateIntervalInSeconds=" + updateIntervalInSeconds + ", applianceId='"
71 + applianceId + '\'' + ", manufacturerName='" + manufacturerName + '\'' + ", friendlyDescription='"
72 + friendlyDescription + '\'' + ", modelName='" + modelName + '\'' + ", friendlyName='"
73 + friendlyName + '\'' + ", reachability='" + reachability + '\'' + ", entityId='" + entityId + '\''
74 + ", applianceNetworkState=" + applianceNetworkState + ", capabilities=" + capabilities + ", tags="
75 + tags + ", applianceTypes=" + applianceTypes + ", aliases=" + aliases + ", groupDevices="
76 + groupDevices + ", connectedVia='" + connectedVia + '\'' + ", driverIdentity=" + driverIdentity
77 + ", mergedApplianceIds=" + mergedApplianceIds + ", smarthomeDevices=" + smarthomeDevices + '}';
81 public static class DriverIdentity {
82 public @Nullable String namespace;
83 public @Nullable String identifier;
86 public String toString() {
87 return "DriverIdentity{" + "namespace='" + namespace + '\'' + ", identifier='" + identifier + '\'' + '}';