2 * Copyright (c) 2010-2022 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.hdpowerview.internal.api.responses;
15 import java.util.List;
16 import java.util.StringJoiner;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
21 import com.google.gson.annotations.SerializedName;
24 * Survey data of a single Shade, as returned by an HD PowerView hub
26 * @author Jacob Laursen - Initial contribution
30 @SerializedName("shade_id")
33 @SerializedName("survey")
34 public List<SurveyData> surveyData;
36 public static class SurveyData {
37 @SerializedName("neighbor_id")
38 public int neighborId;
42 public String toString() {
43 return String.format("{neighbor id:%d, rssi:%d}", neighborId, rssi);
48 public String toString() {
49 List<SurveyData> surveyData = this.surveyData;
50 if (surveyData == null) {
53 StringJoiner joiner = new StringJoiner(", ");
54 surveyData.forEach(data -> joiner.add(data.toString()));
55 return joiner.toString();