mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-26 15:21:41 +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")
|
@SerializedName("actions")
|
||||||
@Expose
|
@Expose
|
||||||
private @Nullable List<MiIoDeviceAction> miIoDeviceActions = new ArrayList<>();
|
private @Nullable List<MiIoDeviceAction> miIoDeviceActions = new ArrayList<>();
|
||||||
|
@SerializedName("readmeComment")
|
||||||
|
@Expose
|
||||||
|
private @Nullable String readmeComment;
|
||||||
|
|
||||||
public String getProperty() {
|
public String getProperty() {
|
||||||
final String property = this.property;
|
final String property = this.property;
|
||||||
@ -184,6 +187,15 @@ public class MiIoBasicChannel {
|
|||||||
this.transfortmation = transfortmation;
|
this.transfortmation = transfortmation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getReadmeComment() {
|
||||||
|
final String readmeComment = this.readmeComment;
|
||||||
|
return (readmeComment != null) ? readmeComment : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReadmeComment(String readmeComment) {
|
||||||
|
this.readmeComment = readmeComment;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "[ Channel = " + getChannel() + ", friendlyName = " + getFriendlyName() + ", type = " + getType()
|
return "[ Channel = " + getChannel() + ", friendlyName = " + getFriendlyName() + ", type = " + getType()
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
"property": "",
|
"property": "",
|
||||||
"friendlyName": "Enable Telnet",
|
"friendlyName": "Enable Telnet",
|
||||||
"channel": "telnetEnable",
|
"channel": "telnetEnable",
|
||||||
|
"readmeComment": "Access the device with telnet to further unlock developer mode. See forum",
|
||||||
"type": "Switch",
|
"type": "Switch",
|
||||||
"refresh": false,
|
"refresh": false,
|
||||||
"actions": [
|
"actions": [
|
||||||
|
@ -115,12 +115,13 @@ public class ReadmeHelper {
|
|||||||
String link = device.getModel().replace(".", "-");
|
String link = device.getModel().replace(".", "-");
|
||||||
sw.write("### " + device.getDescription() + " (" + "<a name=\"" + link + "\">" + device.getModel()
|
sw.write("### " + device.getDescription() + " (" + "<a name=\"" + link + "\">" + device.getModel()
|
||||||
+ "</a>" + ") Channels\r\n" + "\r\n");
|
+ "</a>" + ") Channels\r\n" + "\r\n");
|
||||||
sw.write("| Channel | Type | Description |\r\n");
|
sw.write("| Channel | Type | Description | Comment |\r\n");
|
||||||
sw.write("|------------------|---------|-------------------------------------|\r\n");
|
sw.write("|------------------|---------|-------------------------------------|------------|\r\n");
|
||||||
|
|
||||||
for (MiIoBasicChannel ch : dev.getDevice().getChannels()) {
|
for (MiIoBasicChannel ch : dev.getDevice().getChannels()) {
|
||||||
sw.write("| " + minLengthString(ch.getChannel(), 16) + " | " + minLengthString(ch.getType(), 7)
|
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");
|
sw.write("\r\n");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user