mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +01:00
[miio] allow for comments to channels in json db (#8666)
Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
parent
7b2d184676
commit
a857592f07
File diff suppressed because it is too large
Load Diff
@ -65,6 +65,9 @@ public class MiIoBasicChannel {
|
||||
@SerializedName("actions")
|
||||
@Expose
|
||||
private @Nullable List<MiIoDeviceAction> miIoDeviceActions = new ArrayList<>();
|
||||
@SerializedName("readmeComment")
|
||||
@Expose
|
||||
private @Nullable String readmeComment;
|
||||
|
||||
public String getProperty() {
|
||||
final String property = this.property;
|
||||
@ -184,6 +187,15 @@ public class MiIoBasicChannel {
|
||||
this.transfortmation = transfortmation;
|
||||
}
|
||||
|
||||
public String getReadmeComment() {
|
||||
final String readmeComment = this.readmeComment;
|
||||
return (readmeComment != null) ? readmeComment : "";
|
||||
}
|
||||
|
||||
public void setReadmeComment(String readmeComment) {
|
||||
this.readmeComment = readmeComment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[ Channel = " + getChannel() + ", friendlyName = " + getFriendlyName() + ", type = " + getType()
|
||||
|
@ -13,6 +13,7 @@
|
||||
"property": "",
|
||||
"friendlyName": "Enable Telnet",
|
||||
"channel": "telnetEnable",
|
||||
"readmeComment": "Access the device with telnet to further unlock developer mode. See forum",
|
||||
"type": "Switch",
|
||||
"refresh": false,
|
||||
"actions": [
|
||||
|
@ -115,12 +115,13 @@ public class ReadmeHelper {
|
||||
String link = device.getModel().replace(".", "-");
|
||||
sw.write("### " + device.getDescription() + " (" + "<a name=\"" + link + "\">" + device.getModel()
|
||||
+ "</a>" + ") Channels\r\n" + "\r\n");
|
||||
sw.write("| Channel | Type | Description |\r\n");
|
||||
sw.write("|------------------|---------|-------------------------------------|\r\n");
|
||||
sw.write("| Channel | Type | Description | Comment |\r\n");
|
||||
sw.write("|------------------|---------|-------------------------------------|------------|\r\n");
|
||||
|
||||
for (MiIoBasicChannel ch : dev.getDevice().getChannels()) {
|
||||
sw.write("| " + minLengthString(ch.getChannel(), 16) + " | " + minLengthString(ch.getType(), 7)
|
||||
+ " | " + minLengthString(ch.getFriendlyName(), 35) + " |\r\n");
|
||||
+ " | " + minLengthString(ch.getFriendlyName(), 35) + " | "
|
||||
+ minLengthString(ch.getReadmeComment(), 10) + " |\r\n");
|
||||
}
|
||||
sw.write("\r\n");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user