Compare commits

..

3 Commits

Author SHA1 Message Date
mlobstein
b461d1b648
Merge 379f00fb95 into d36b2a8d82 2025-01-08 13:30:55 -06:00
jimtng
d36b2a8d82
[basicprofiles] Add a table-of-contents at top of README.md (#18058)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-01-08 20:15:25 +01:00
Mark Herwege
5ac2780749
fix offline when image not available (#18066)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2025-01-08 20:03:21 +01:00
3 changed files with 36 additions and 7 deletions

View File

@ -365,13 +365,19 @@ public class SpeedtestHandler extends BaseThingHandler {
isp = tmpCont.getIsp();
interfaceInternalIp = tmpCont.getInterface().getInternalIp();
interfaceExternalIp = tmpCont.getInterface().getExternalIp();
resultUrl = tmpCont.getResult().getUrl();
String url = String.valueOf(resultUrl) + ".png";
logger.debug("Downloading result image from: {}", url);
RawType image = HttpUtil.downloadImage(url);
if (image != null) {
resultImage = image;
if (tmpCont.getResult().isPersisted()) {
resultUrl = tmpCont.getResult().getUrl();
String url = String.valueOf(resultUrl) + ".png";
logger.debug("Downloading result image from: {}", url);
RawType image = HttpUtil.downloadImage(url);
if (image != null) {
resultImage = image;
} else {
resultImage = UnDefType.NULL;
}
} else {
logger.debug("Result image not persisted");
resultUrl = "";
resultImage = UnDefType.NULL;
}

View File

@ -263,6 +263,9 @@ public class ResultContainer {
@SerializedName("url")
@Expose
private String url;
@SerializedName("persisted")
@Expose
private boolean persisted;
public String getId() {
return id;
@ -279,6 +282,14 @@ public class ResultContainer {
public void setUrl(String url) {
this.url = url;
}
public boolean isPersisted() {
return persisted;
}
public void setPersisted(boolean persisted) {
this.persisted = persisted;
}
}
public class Server {

View File

@ -1,6 +1,18 @@
# Basic Profiles
This bundle provides a list of useful Profiles.
This bundle provides a list of useful Profiles:
| Profile | Description |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [Generic Command Profile](#generic-command-profile) | Sends a Command towards the Item when an event is triggered |
| [Generic Toggle Switch Profile](#generic-toggle-switch-profile) | Toggles a Switch Item when an event is triggered |
| [Debounce (Counting) Profile](#debounce-counting-profile) | Counts and skip a number of State changes |
| [Debounce (Time) Profile](#debounce-time-profile) | Reduces the frequency of commands/state updates |
| [Invert / Negate Profile](#invert--negate-profile) | Inverts or negate a Command / State |
| [Round Profile](#round-profile) | Reduces the number of decimal places from input data |
| [Threshold Profile](#threshold-profile) | Translates numeric input data to `ON` or `OFF` based on a threshold value |
| [Time Range Command Profile](#time-range-command-profile) | An enhanced implementation of a follow profile which converts `OnOffType` to a `PercentType` |
| [State Filter Profile](#state-filter-profile) | Filters input data using arithmetic comparison conditions |
## Generic Command Profile