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.hue.internal.api.dto.clip1;
15 import java.util.ArrayList;
16 import java.util.Date;
17 import java.util.List;
20 import com.google.gson.annotations.SerializedName;
23 * Detailed bridge info available if authenticated.
25 * @author Q42 - Initial contribution
26 * @author Denis Dudnik - moved Jue library source code inside the smarthome Hue binding, minor code cleanup
27 * @author Samuel Leisering - added API-Version
31 private String swversion;
32 private String apiversion;
33 private String bridgeid;
35 private String modelid;
37 private String ipaddress;
38 private String netmask;
39 private String gateway;
40 private String proxyaddress;
41 private int proxyport;
42 @SerializedName("UTC")
44 private boolean linkbutton;
45 private Map<String, User> whitelist;
46 private SoftwareUpdate swupdate;
54 * @return name of the bridge
56 public String getName() {
61 * Returns the version of the software.
63 * @return version of software on the bridge
65 public String getSoftwareVersion() {
70 * Returns the bridge id
74 public String getBridgeId() {
79 * Returns the MAC address.
81 * @return mac address of bridge
83 public String getMACAddress() {
88 * Returns the model id
92 public String getModelId() {
97 * Returns if the current IP address was obtained with DHCP.
99 * @return true if the current IP address was obtained with DHCP, false otherwise.
101 public boolean isDHCPEnabled() {
106 * Returns the IP address.
108 * @return ip address of bridge
110 public String getIPAddress() {
115 * Returns the network mask.
117 * @return network mask
119 public String getNetworkMask() {
124 * Returns the IP address of the gateway.
126 * @return ip address of gateway
128 public String getGateway() {
133 * Returns the IP address of the proxy or null if there is none.
135 * @return ip address of proxy or null
137 public String getProxyAddress() {
138 return "none".equals(proxyaddress) ? null : proxyaddress;
142 * Returns the port of the proxy or null if there is none.
144 * @return port of proxy or null
146 public Integer getProxyPort() {
147 return "none".equals(proxyaddress) ? null : proxyport;
151 * Returns the time on the bridge.
153 * @return time on the bridge
155 public Date getUTCTime() {
160 * Returns if the link button has been pressed within the last 30 seconds.
162 * @return true if the link button has been pressed within the last 30 seconds, false otherwise
164 public boolean isLinkButtonPressed() {
169 * Returns the list of whitelisted users.
171 * @return list of whitelisted users
173 public List<User> getWhitelist() {
174 ArrayList<User> usersList = new ArrayList<>();
176 usersList.addAll(whitelist.values());
182 * Returns information about a bridge firmware update.
184 * @return bridge firmware update info
186 public SoftwareUpdate getSoftwareUpdate() {
191 * Returns the current API-Version of the Bridge. This always returns <code>1.0</code>
192 * for bridges with version less than <code>1.2.1</code>, which introduces this call.
196 public String getApiVersion() {
197 if (apiversion == null) {