From a1d04dd3f06d8e8409bb037df893c24ca2cec113 Mon Sep 17 00:00:00 2001 From: Tester23 Date: Wed, 16 Aug 2023 09:40:01 +0200 Subject: [PATCH] better docs --- docs/commands-extended.md | 8 ++++---- docs/commands.md | 8 ++++---- docs/json/commands.json | 8 ++++---- src/driver/drv_cht8305.c | 4 ++-- src/driver/drv_mcp9808.c | 4 ++-- src/driver/drv_tuyaMCU.c | 2 ++ 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/docs/commands-extended.md b/docs/commands-extended.md index 7f13a2f19..04003206f 100644 --- a/docs/commands-extended.md +++ b/docs/commands-extended.md @@ -33,8 +33,8 @@ Do not add anything here, as it will overwritten with next rebuild. | cancelRepeatingEvent | [UserIDInteger] | Stops a given repeating event with a specified ID | File: cmnds/cmd_repeatingEvents.c
Function: RepeatingEvents_Cmd_CancelRepeatingEvent | | Ch | [InputValue] | An alternate command to access channels. It returns all used channels in JSON format. The syntax is ChINDEX value, there is no space between Ch and channel index. It can be sent without value to poll channel values. | File: cmnds/cmd_channels.c
Function: CMD_Ch | | chSetupLimit | [limitChannelIndex] [maxAllowedLimitChannelDelta] [timeoutOr-1] [commandToRun] | After executing this command, chargingLimit driver will watch channel for changes and count down timer. When a timer runs our or channel change (from the initial state) is larger than given margin, given command is run | File: driver/drv_chargingLimit.c
Function: ChargingLimit_SetupCommand); | -| CHT_Calibrate | | Calibrate the CHT Sensor as Tolerance is +/-2 degrees C.
e.g.:SHT_Calibrate -4 10 | File: driver/drv_cht8305.c
Function: CHT_Calibrate | -| CHT_Cycle | [int] | This is the interval between measurements in seconds, by default 1. Max is 255.
e.g.:CHT_Cycle 60 | File: drv/drv_cht8305.c
Function: CHT_cycle | +| CHT_Calibrate | [DeltaTemp][DeltaHumidity] | Calibrate the CHT Sensor as Tolerance is +/-2 degrees C.
e.g.:SHT_Calibrate -4 10 | File: driver/drv_cht8305.c
Function: CHT_Calibrate | +| CHT_Cycle | [IntervalSeconds] | This is the interval between measurements in seconds, by default 1. Max is 255.
e.g.:CHT_Cycle 60 | File: drv/drv_cht8305.c
Function: CHT_cycle | | ClampChannel | [ChannelIndex][Min][Max] | Clamps given channel value to a range. | File: cmnds/cmd_channels.c
Function: CMD_ClampChannel | | clearAll | | Clears config and all remaining features, like runtime scripts, events, etc | File: cmnds/cmd_main.c
Function: CMD_ClearAll | | clearAllHandlers | | This clears all added event handlers | File: cmnds/cmd_eventHandlers.c
Function: CMD_ClearAllHandlers | @@ -139,8 +139,8 @@ Do not add anything here, as it will overwritten with next rebuild. | MCP9808_Adr | MCP9808_Adr | | File: driver/drv_mcp9808.c
Function: NULL); | | MCP9808_AlertMin | MCP9808_AlertMin | | File: driver/drv_mcp9808.c
Function: NULL); | | MCP9808_AlertRange | MCP9808_AlertRange | | File: driver/drv_mcp9808.c
Function: NULL); | -| MCP9808_Calibrate | MCP9808_Calibrate | | File: driver/drv_mcp9808.c
Function: NULL); | -| MCP9808_Cycle | MCP9808_cycle | | File: driver/drv_mcp9808.c
Function: NULL); | +| MCP9808_Calibrate | [DeltaTemperature] | | File: driver/drv_mcp9808.c
Function: NULL); | +| MCP9808_Cycle | [DelayInSeconds] | | File: driver/drv_mcp9808.c
Function: NULL); | | MqttClient | [ValueString] | Sets the MQTT client. Command keeps Tasmota syntax | File: cmnds/cmd_tasmota.c
Function: cmnd_MqttClient | | MqttHost | [ValueString] | Sets the MQTT host. Command keeps Tasmota syntax | File: cmnds/cmd_tasmota.c
Function: cmnd_MqttHost | | MqttPassword | [ValueString] | Sets the MQTT pass. Command keeps Tasmota syntax | File: cmnds/cmd_tasmota.c
Function: cmnd_MqttPassword | diff --git a/docs/commands.md b/docs/commands.md index 3d405f1f2..7a0dfcfaa 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -36,8 +36,8 @@ Do not add anything here, as it will overwritten with next rebuild. | cancelRepeatingEvent | [UserIDInteger] | Stops a given repeating event with a specified ID | | Ch | [InputValue] | An alternate command to access channels. It returns all used channels in JSON format. The syntax is ChINDEX value, there is no space between Ch and channel index. It can be sent without value to poll channel values. | | chSetupLimit | [limitChannelIndex] [maxAllowedLimitChannelDelta] [timeoutOr-1] [commandToRun] | After executing this command, chargingLimit driver will watch channel for changes and count down timer. When a timer runs our or channel change (from the initial state) is larger than given margin, given command is run | -| CHT_Calibrate | | Calibrate the CHT Sensor as Tolerance is +/-2 degrees C.
e.g.:SHT_Calibrate -4 10 | -| CHT_Cycle | [int] | This is the interval between measurements in seconds, by default 1. Max is 255.
e.g.:CHT_Cycle 60 | +| CHT_Calibrate | [DeltaTemp][DeltaHumidity] | Calibrate the CHT Sensor as Tolerance is +/-2 degrees C.
e.g.:SHT_Calibrate -4 10 | +| CHT_Cycle | [IntervalSeconds] | This is the interval between measurements in seconds, by default 1. Max is 255.
e.g.:CHT_Cycle 60 | | ClampChannel | [ChannelIndex][Min][Max] | Clamps given channel value to a range. | | clearAll | | Clears config and all remaining features, like runtime scripts, events, etc | | clearAllHandlers | | This clears all added event handlers | @@ -142,8 +142,8 @@ Do not add anything here, as it will overwritten with next rebuild. | MCP9808_Adr | MCP9808_Adr | | | MCP9808_AlertMin | MCP9808_AlertMin | | | MCP9808_AlertRange | MCP9808_AlertRange | | -| MCP9808_Calibrate | MCP9808_Calibrate | | -| MCP9808_Cycle | MCP9808_cycle | | +| MCP9808_Calibrate | [DeltaTemperature] | | +| MCP9808_Cycle | [DelayInSeconds] | | | MqttClient | [ValueString] | Sets the MQTT client. Command keeps Tasmota syntax | | MqttHost | [ValueString] | Sets the MQTT host. Command keeps Tasmota syntax | | MqttPassword | [ValueString] | Sets the MQTT pass. Command keeps Tasmota syntax | diff --git a/docs/json/commands.json b/docs/json/commands.json index 2dd3261fb..480604c38 100644 --- a/docs/json/commands.json +++ b/docs/json/commands.json @@ -253,7 +253,7 @@ }, { "name": "CHT_Calibrate", - "args": "", + "args": "[DeltaTemp][DeltaHumidity]", "descr": "Calibrate the CHT Sensor as Tolerance is +/-2 degrees C.", "fn": "CHT_Calibrate", "file": "driver/drv_cht8305.c", @@ -262,7 +262,7 @@ }, { "name": "CHT_Cycle", - "args": "[int]", + "args": "[IntervalSeconds]", "descr": "This is the interval between measurements in seconds, by default 1. Max is 255.", "fn": "CHT_cycle", "file": "drv/drv_cht8305.c", @@ -1207,7 +1207,7 @@ }, { "name": "MCP9808_Calibrate", - "args": "MCP9808_Calibrate", + "args": "[DeltaTemperature]", "descr": "", "fn": "NULL);", "file": "driver/drv_mcp9808.c", @@ -1216,7 +1216,7 @@ }, { "name": "MCP9808_Cycle", - "args": "MCP9808_cycle", + "args": "[DelayInSeconds]", "descr": "", "fn": "NULL);", "file": "driver/drv_mcp9808.c", diff --git a/src/driver/drv_cht8305.c b/src/driver/drv_cht8305.c index 00319d934..28fe117a9 100644 --- a/src/driver/drv_cht8305.c +++ b/src/driver/drv_cht8305.c @@ -98,12 +98,12 @@ void CHT8305_Init() { addLogAdv(LOG_INFO, LOG_FEATURE_SENSOR, "DRV_CHT8304_init: ID: %02X %02X", buff[0], buff[1]); - //cmddetail:{"name":"CHT_Calibrate","args":"", + //cmddetail:{"name":"CHT_Calibrate","args":"[DeltaTemp][DeltaHumidity]", //cmddetail:"descr":"Calibrate the CHT Sensor as Tolerance is +/-2 degrees C.", //cmddetail:"fn":"CHT_Calibrate","file":"driver/drv_cht8305.c","requires":"", //cmddetail:"examples":"SHT_Calibrate -4 10"} CMD_RegisterCommand("CHT_Calibrate", CHT_Calibrate, NULL); - //cmddetail:{"name":"CHT_Cycle","args":"[int]", + //cmddetail:{"name":"CHT_Cycle","args":"[IntervalSeconds]", //cmddetail:"descr":"This is the interval between measurements in seconds, by default 1. Max is 255.", //cmddetail:"fn":"CHT_cycle","file":"drv/drv_cht8305.c","requires":"", //cmddetail:"examples":"CHT_Cycle 60"} diff --git a/src/driver/drv_mcp9808.c b/src/driver/drv_mcp9808.c index 29d596740..35f37c8a7 100644 --- a/src/driver/drv_mcp9808.c +++ b/src/driver/drv_mcp9808.c @@ -257,12 +257,12 @@ void MCP9808_Init() { CMD_RegisterCommand("MCP9808_AlertMin", MCP9808_AlertMin, NULL); - //cmddetail:{"name":"MCP9808_Calibrate","args":"MCP9808_Calibrate", + //cmddetail:{"name":"MCP9808_Calibrate","args":"[DeltaTemperature]", //cmddetail:"descr":"", //cmddetail:"fn":"NULL);","file":"driver/drv_mcp9808.c","requires":"", //cmddetail:"examples":""} CMD_RegisterCommand("MCP9808_Calibrate", MCP9808_Calibrate, NULL); - //cmddetail:{"name":"MCP9808_Cycle","args":"MCP9808_cycle", + //cmddetail:{"name":"MCP9808_Cycle","args":"[DelayInSeconds]", //cmddetail:"descr":"", //cmddetail:"fn":"NULL);","file":"driver/drv_mcp9808.c","requires":"", //cmddetail:"examples":""} diff --git a/src/driver/drv_tuyaMCU.c b/src/driver/drv_tuyaMCU.c index 01180c8be..b10470f67 100644 --- a/src/driver/drv_tuyaMCU.c +++ b/src/driver/drv_tuyaMCU.c @@ -567,6 +567,8 @@ void TuyaMCU_SendColor(int dpID, float fR, float fG, float fB, int tuyaRGB) { // tuyaMCU_sendColor dpID red01 green01 blue01 tuyaRGB // tuyaMCU_sendColor 24 1 0 0 1 // tuyaMCU_sendColor 24 1 0 0 1 +// green: +// tuyaMCU_sendColor 24 0 1 0 1 commandResult_t Cmd_TuyaMCU_SendColor(const void* context, const char* cmd, const char* args, int cmdFlags) { int toSend; float fR, fG, fB;