forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support refresh command for signalStrength items. (openhab#11944)
Fixes openhab#11942 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
- Loading branch information
Showing
4 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...owerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/responses/Survey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Copyright (c) 2010-2021 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.hdpowerview.internal.api.responses; | ||
|
||
import java.util.List; | ||
import java.util.StringJoiner; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* Survey data of a single Shade, as returned by an HD PowerView hub | ||
* | ||
* @author Jacob Laursen - Initial contribution | ||
*/ | ||
public class Survey { | ||
@SerializedName("shade_id") | ||
public int shadeId; | ||
@SerializedName("survey") | ||
public List<SurveyData> surveyData; | ||
|
||
public static class SurveyData { | ||
@SerializedName("neighbor_id") | ||
public int neighborId; | ||
public int rssi; | ||
|
||
@Override | ||
public String toString() { | ||
return String.format("{neighbor id:%d, rssi:%d}", neighborId, rssi); | ||
} | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
if (surveyData == null) { | ||
return "{}"; | ||
} | ||
StringJoiner joiner = new StringJoiner(", "); | ||
surveyData.forEach(data -> joiner.add(data.toString())); | ||
return joiner.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters