]> git.basschouten.com Git - openhab-addons.git/commitdiff
[miio] update line endings for readme maker (#9142)
authorMarcel <marcelrv@users.noreply.github.com>
Thu, 26 Nov 2020 22:53:55 +0000 (23:53 +0100)
committerGitHub <noreply@github.com>
Thu, 26 Nov 2020 22:53:55 +0000 (14:53 -0800)
Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
bundles/org.openhab.binding.miio/src/test/java/org/openhab/binding/miio/internal/ReadmeHelper.java

index 877a477efc1a02483011cad81e71bf19fa9bf33f..9f56e3203c241c4e73a35739b9fcad818ce12de1 100644 (file)
@@ -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");
                 }
             }
         });