[miio] update line endings for readme maker (#9142)
Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
parent
3fb0b86989
commit
8040a710fd
|
@ -86,11 +86,11 @@ public class ReadmeHelper {
|
|||
LOGGER.info(devicesCount);
|
||||
StringWriter sw = new StringWriter();
|
||||
sw.write(devicesCount);
|
||||
sw.write("\r\n\r\n");
|
||||
sw.write("\n\n");
|
||||
sw.write(
|
||||
"| Device | ThingType | Device Model | Supported | Remark |\r\n");
|
||||
"| Device | ThingType | Device Model | Supported | Remark |\n");
|
||||
sw.write(
|
||||
"|------------------------------|------------------|------------------------|-----------|------------|\r\n");
|
||||
"|------------------------------|------------------|------------------------|-----------|------------|\n");
|
||||
|
||||
Arrays.asList(MiIoDevices.values()).forEach(device -> {
|
||||
if (!device.getModel().equals("unknown")) {
|
||||
|
@ -119,7 +119,7 @@ public class ReadmeHelper {
|
|||
sw.write(isSupported ? "No " : "Yes ");
|
||||
sw.write(" | ");
|
||||
sw.write(minLengthString(remark, 10));
|
||||
sw.write(" |\r\n");
|
||||
sw.write(" |\n");
|
||||
}
|
||||
});
|
||||
return sw;
|
||||
|
@ -134,16 +134,16 @@ public class ReadmeHelper {
|
|||
if (dev != null) {
|
||||
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 | Comment |\r\n");
|
||||
sw.write("|------------------|---------|-------------------------------------|------------|\r\n");
|
||||
+ "</a>" + ") Channels\n" + "\n");
|
||||
sw.write("| Channel | Type | Description | Comment |\n");
|
||||
sw.write("|------------------|---------|-------------------------------------|------------|\n");
|
||||
|
||||
for (MiIoBasicChannel ch : dev.getDevice().getChannels()) {
|
||||
sw.write("| " + minLengthString(ch.getChannel(), 16) + " | " + minLengthString(ch.getType(), 7)
|
||||
+ " | " + minLengthString(ch.getFriendlyName(), 35) + " | "
|
||||
+ minLengthString(ch.getReadmeComment(), 10) + " |\r\n");
|
||||
+ minLengthString(ch.getReadmeComment(), 10) + " |\n");
|
||||
}
|
||||
sw.write("\r\n");
|
||||
sw.write("\n");
|
||||
|
||||
} else {
|
||||
LOGGER.info("Pls check: Device not found in db: {}", device);
|
||||
|
@ -159,20 +159,20 @@ public class ReadmeHelper {
|
|||
if (device.getThingType().equals(MiIoBindingConstants.THING_TYPE_BASIC)) {
|
||||
MiIoBasicDevice dev = findDatabaseEntry(device.getModel());
|
||||
if (dev != null) {
|
||||
sw.write("### " + device.getDescription() + " (" + device.getModel() + ") item file lines\r\n\r\n");
|
||||
sw.write("### " + device.getDescription() + " (" + device.getModel() + ") item file lines\n\n");
|
||||
String[] ids = device.getModel().split("\\.");
|
||||
String id = ids[ids.length - 2];
|
||||
String gr = "G_" + id;
|
||||
sw.write("note: Autogenerated example. Replace the id (" + id
|
||||
+ ") in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.\r\n");
|
||||
sw.write("\r\n```java\r\n");
|
||||
sw.write("Group " + gr + " \"" + device.getDescription() + "\" <status>\r\n");
|
||||
+ ") in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.\n");
|
||||
sw.write("\n```java\n");
|
||||
sw.write("Group " + gr + " \"" + device.getDescription() + "\" <status>\n");
|
||||
|
||||
for (MiIoBasicChannel ch : dev.getDevice().getChannels()) {
|
||||
sw.write(ch.getType() + " " + ch.getChannel() + " \"" + ch.getFriendlyName() + "\" (" + gr
|
||||
+ ") {channel=\"miio:basic:" + id + ":" + ch.getChannel() + "\"}\r\n");
|
||||
+ ") {channel=\"miio:basic:" + id + ":" + ch.getChannel() + "\"}\n");
|
||||
}
|
||||
sw.write("```\r\n\r\n");
|
||||
sw.write("```\n\n");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue