From 9c26730d890547200a6bf721dc4b63bbf2cf2e3e Mon Sep 17 00:00:00 2001 From: openshwprojects Date: Mon, 6 Mar 2023 19:09:44 +0100 Subject: [PATCH] styling --- docs/README.md | 2 +- docs/autoexecExamples.md | 14 ++++++++++---- scripts/getcommands.js | 9 +++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/README.md b/docs/README.md index 3f1db1764..3f99ff151 100644 --- a/docs/README.md +++ b/docs/README.md @@ -13,5 +13,5 @@ Do not add anything here, as it will overwritten with next rebuild. | [FAQ](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/faq.md) (15 total) | Here is a detailed list of questions you may ask. Some information from docs is repeated here. | | [Console/Script commands](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md) (225 total) | There are multiple console commands that allow you to automate your devices. Commands can be entered manually in command line, can be send by HTTP (just like in Tasmota), can be send by MQTT and also can be scripted. | | [Command Examples](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commandExamples.md) (6 total) | Here you can find some examples of console commands usage | -| [Autoexec.bat examples (configs)](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md) (2 total) | undefined | +| [Autoexec.bat examples (configs)](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md) (2 total) | Here you can find examples of autoexec.bat configs. The autoexec.bat file can be created in Web Application, under LittleFS tab, and is run every time device reboots (unless device enters safe mode/AP mode). The autoexec.bat file allows you to create more advanced configs, setup TuyaMCU mappings, etc | | [Console/Script commands [Extended Edition]](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands-extended.md) (225 total) | More details on commands. | diff --git a/docs/autoexecExamples.md b/docs/autoexecExamples.md index b751937d6..7ea379d85 100644 --- a/docs/autoexecExamples.md +++ b/docs/autoexecExamples.md @@ -1,17 +1,22 @@ # Example 'autoexec.bat' files -[Configuration for EDM-01AA-EU dimmer with TuyaMCU](https://www.elektroda.com/rtvforum/topic3929151.html)*
```startDriver TuyaMCU +[Configuration for EDM-01AA-EU dimmer with TuyaMCU](https://www.elektroda.com/rtvforum/topic3929151.html)* +
``` +startDriver TuyaMCU setChannelType 1 toggle setChannelType 2 dimmer tuyaMcu_setBaudRate 115200 tuyaMcu_setDimmerRange 1 1000 // linkTuyaMCUOutputToChannel dpId verType tgChannel linkTuyaMCUOutputToChannel 1 bool 1 -linkTuyaMCUOutputToChannel 2 val 2``` +linkTuyaMCUOutputToChannel 2 val 2 +``` -[Configuration for QIACHIP Universal WIFI Ceiling Fan Light Remote Control Kit - BK7231N - CB2S with TuyaMCU](https://www.elektroda.com/rtvforum/topic3895301.html)*
```// start MCU driver +[Configuration for QIACHIP Universal WIFI Ceiling Fan Light Remote Control Kit - BK7231N - CB2S with TuyaMCU](https://www.elektroda.com/rtvforum/topic3895301.html)* +
``` +// start MCU driver startDriver TuyaMCU // let's say that channel 1 is dpid1 - fan on/off setChannelType 1 toggle @@ -37,6 +42,7 @@ linkTuyaMCUOutputToChannel 6 4 5 // //dpId 7, dataType 2-DP_TYPE_VALUE = timer remaining setChannelType 6 ReadOnly -linkTuyaMCUOutputToChannel 7 2 6``` +linkTuyaMCUOutputToChannel 7 2 6 +``` diff --git a/scripts/getcommands.js b/scripts/getcommands.js index c21ca1af8..c80b4f894 100644 --- a/scripts/getcommands.js +++ b/scripts/getcommands.js @@ -809,8 +809,13 @@ for (let i = 0; i < autoexecExamples.length; i++) { let exe = autoexecExamples[i]; autoexecsmdshort += "" + exe.title + "*"; + autoexecsmdshort += '\n'; autoexecsmdshort += '
'; - autoexecsmdshort += "```" + exe.fileText + "```"; + autoexecsmdshort += "```"; + autoexecsmdshort += '\n'; + autoexecsmdshort += exe.fileText; + autoexecsmdshort += '\n'; + autoexecsmdshort += "```"; autoexecsmdshort += '\n'; autoexecsmdshort += '\n'; @@ -961,7 +966,7 @@ writeDocMD('channelTypes', channelsmdshort, channels, "Channel Types", true, gen writeDocMD('faq', faqmdshort, faq, "FAQ", false, generic.faq); writeDocMD('commands', mdshort, commands, "Console/Script commands", true, generic.commands); writeDocMD('commandExamples', commandExamplesmdshort, commandExamples, "Command Examples", false, generic.commandExamples); -writeDocMD('autoexecExamples', autoexecsmdshort, autoexecExamples, "Autoexec.bat examples (configs)", false, generic.autoexecs); +writeDocMD('autoexecExamples', autoexecsmdshort, autoexecExamples, "Autoexec.bat examples (configs)", false, generic.autoexecExamples); writeDocMD('commands-extended', mdlong, commands, "Console/Script commands [Extended Edition]", false, "More details on commands.") let links_md =