diff --git a/docs/commands-extended.md b/docs/commands-extended.md
index 917c1cde6..28e51b884 100644
--- a/docs/commands-extended.md
+++ b/docs/commands-extended.md
@@ -6,7 +6,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| Command | Arguments | Description | Location |
|:------------- |:-------------:|:----- | ------:|
| AB_Map | [int] | Sets margines for ADC button codes. For given N margins, there are N+1 possible ADC button values (one should be reserved for 'no button').
See also [AB_Map on forum](https://www.elektroda.com/rtvforum/find.php?q=AB_Map). | File: drv/drv_adcButton.c
Function: Cmd_ADCButtonMap |
-| ADCSmoother | Cmd_SetupADCSmoother | .
See also [ADCSmoother on forum](https://www.elektroda.com/rtvforum/find.php?q=ADCSmoother). | File: driver/drv_adcSmoother.c
Function: NULL); |
+| ADCSmoother | [Pindex] [TotalSamples] [SampleIntervalMS] [TargetChannelADCValue] [MarginValue] [TargetChannel0or1] | Starts the ADC smoother with given configuration.
See also [ADCSmoother on forum](https://www.elektroda.com/rtvforum/find.php?q=ADCSmoother). | File: driver/drv_adcSmoother.c
Function: NULL); |
| AddChangeHandler | [Variable][Relation][Constant][Command] | This can listen to change in channel value (for example channel 0 becoming 100), or for a voltage/current/power change for BL0942/BL0937. This supports multiple relations, like ==, !=, >=, < etc. The Variable name for channel is Channel0, Channel2, etc, for BL0XXX it can be 'Power', or 'Current' or 'Voltage'.
See also [AddChangeHandler on forum](https://www.elektroda.com/rtvforum/find.php?q=AddChangeHandler). | File: cmnds/cmd_eventHandlers.c
Function: CMD_AddChangeHandler |
| AddChannel | [ChannelIndex][ValueToAdd][ClampMin][ClampMax][bWrapInsteadOfClamp] | Adds a given value to the channel. Can be used to change PWM brightness. Clamp min and max arguments are optional.
See also [AddChannel on forum](https://www.elektroda.com/rtvforum/find.php?q=AddChannel). | File: cmnds/cmd_channels.c
Function: CMD_AddChannel |
| addClockEvent | [Time] [WeekDayFlags] [UniqueIDForRemoval][Command] | Schedule command to run on given time in given day of week. NTP must be running. Time is a time like HH:mm or HH:mm:ss, WeekDayFlag is a bitflag on which day to run, 0xff mean all days, 0x01 means sunday, 0x02 monday, 0x03 sunday and monday, etc, id is an unique id so event can be removede later.
See also [addClockEvent on forum](https://www.elektroda.com/rtvforum/find.php?q=addClockEvent). | File: driver/drv_ntp_events.c
Function: CMD_NTP_AddClockEvent |
@@ -177,7 +177,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| restart | | Reboots the module.
See also [restart on forum](https://www.elektroda.com/rtvforum/find.php?q=restart). | File: cmnds/cmd_main.c
Function: CMD_Restart |
| return | | Script-only command. Currently it just stops totally current script thread.
See also [return on forum](https://www.elektroda.com/rtvforum/find.php?q=return). | File: cmnds/cmd_script.c
Function: CMD_Return |
| SafeMode | [OptionalDelayBeforeRestart] | Forces device reboot into safe mode (open ap with disabled drivers). Argument is a delay to restart in seconds, optional, minimal delay is 1.
See also [SafeMode on forum](https://www.elektroda.com/rtvforum/find.php?q=SafeMode). | File: cmnds/cmd_main.c
Function: CMD_SafeMode |
-| scanI2C | | .
See also [scanI2C on forum](https://www.elektroda.com/rtvforum/find.php?q=scanI2C). | File: i2c/drv_i2c_main.c
Function: DRV_I2C_MCP23017_MapPinToChannel |
+| scanI2C | [Soft/I2C1/I2C2] | Scans given I2C line for addresses. I2C driver must be started first.
See also [scanI2C on forum](https://www.elektroda.com/rtvforum/find.php?q=scanI2C). | File: i2c/drv_i2c_main.c
Function: DRV_I2C_MCP23017_MapPinToChannel |
| scheduleHADiscovery | [Seconds] | This will schedule HA discovery, the discovery will happen with given number of seconds, but timer only counts when MQTT is connected. It will not work without MQTT online, so you must set MQTT credentials first.
See also [scheduleHADiscovery on forum](https://www.elektroda.com/rtvforum/find.php?q=scheduleHADiscovery). | File: cmnds/cmd_main.c
Function: CMD_ScheduleHADiscovery |
| sendGet | [TargetURL] | Sends a HTTP GET request to target URL. May include GET arguments. Can be used to control devices by Tasmota HTTP protocol. Command supports argument expansion, so $CH11 changes to value of channel 11, etc, etc.
See also [sendGet on forum](https://www.elektroda.com/rtvforum/find.php?q=sendGet). | File: cmnds/cmd_send.c
Function: CMD_SendGET |
| sendPOST | [TargetURL] [HTTP Port] [Content Type] [Post Content] | Sends a HTTP POST request to target URL. Arguments can contain variable expansion.
See also [sendPOST on forum](https://www.elektroda.com/rtvforum/find.php?q=sendPOST). | File: cmnds/cmd_send.c
Function: CMD_SendPOST |
diff --git a/docs/commands.md b/docs/commands.md
index b7b969ba1..9c344f16f 100644
--- a/docs/commands.md
+++ b/docs/commands.md
@@ -9,7 +9,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| Command | Arguments | Description |
|:------------- |:------------- | -----:|
| AB_Map | [int] | Sets margines for ADC button codes. For given N margins, there are N+1 possible ADC button values (one should be reserved for 'no button').
See also [AB_Map on forum](https://www.elektroda.com/rtvforum/find.php?q=AB_Map). |
-| ADCSmoother | Cmd_SetupADCSmoother | .
See also [ADCSmoother on forum](https://www.elektroda.com/rtvforum/find.php?q=ADCSmoother). |
+| ADCSmoother | [Pindex] [TotalSamples] [SampleIntervalMS] [TargetChannelADCValue] [MarginValue] [TargetChannel0or1] | Starts the ADC smoother with given configuration.
See also [ADCSmoother on forum](https://www.elektroda.com/rtvforum/find.php?q=ADCSmoother). |
| AddChangeHandler | [Variable][Relation][Constant][Command] | This can listen to change in channel value (for example channel 0 becoming 100), or for a voltage/current/power change for BL0942/BL0937. This supports multiple relations, like ==, !=, >=, < etc. The Variable name for channel is Channel0, Channel2, etc, for BL0XXX it can be 'Power', or 'Current' or 'Voltage'.
See also [AddChangeHandler on forum](https://www.elektroda.com/rtvforum/find.php?q=AddChangeHandler). |
| AddChannel | [ChannelIndex][ValueToAdd][ClampMin][ClampMax][bWrapInsteadOfClamp] | Adds a given value to the channel. Can be used to change PWM brightness. Clamp min and max arguments are optional.
See also [AddChannel on forum](https://www.elektroda.com/rtvforum/find.php?q=AddChannel). |
| addClockEvent | [Time] [WeekDayFlags] [UniqueIDForRemoval][Command] | Schedule command to run on given time in given day of week. NTP must be running. Time is a time like HH:mm or HH:mm:ss, WeekDayFlag is a bitflag on which day to run, 0xff mean all days, 0x01 means sunday, 0x02 monday, 0x03 sunday and monday, etc, id is an unique id so event can be removede later.
See also [addClockEvent on forum](https://www.elektroda.com/rtvforum/find.php?q=addClockEvent). |
@@ -180,7 +180,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| restart | | Reboots the module.
See also [restart on forum](https://www.elektroda.com/rtvforum/find.php?q=restart). |
| return | | Script-only command. Currently it just stops totally current script thread.
See also [return on forum](https://www.elektroda.com/rtvforum/find.php?q=return). |
| SafeMode | [OptionalDelayBeforeRestart] | Forces device reboot into safe mode (open ap with disabled drivers). Argument is a delay to restart in seconds, optional, minimal delay is 1.
See also [SafeMode on forum](https://www.elektroda.com/rtvforum/find.php?q=SafeMode). |
-| scanI2C | | .
See also [scanI2C on forum](https://www.elektroda.com/rtvforum/find.php?q=scanI2C). |
+| scanI2C | [Soft/I2C1/I2C2] | Scans given I2C line for addresses. I2C driver must be started first.
See also [scanI2C on forum](https://www.elektroda.com/rtvforum/find.php?q=scanI2C). |
| scheduleHADiscovery | [Seconds] | This will schedule HA discovery, the discovery will happen with given number of seconds, but timer only counts when MQTT is connected. It will not work without MQTT online, so you must set MQTT credentials first.
See also [scheduleHADiscovery on forum](https://www.elektroda.com/rtvforum/find.php?q=scheduleHADiscovery). |
| sendGet | [TargetURL] | Sends a HTTP GET request to target URL. May include GET arguments. Can be used to control devices by Tasmota HTTP protocol. Command supports argument expansion, so $CH11 changes to value of channel 11, etc, etc.
See also [sendGet on forum](https://www.elektroda.com/rtvforum/find.php?q=sendGet). |
| sendPOST | [TargetURL] [HTTP Port] [Content Type] [Post Content] | Sends a HTTP POST request to target URL. Arguments can contain variable expansion.
See also [sendPOST on forum](https://www.elektroda.com/rtvforum/find.php?q=sendPOST). |
diff --git a/docs/json/commands.json b/docs/json/commands.json
index da0c1ce78..16d960cf0 100644
--- a/docs/json/commands.json
+++ b/docs/json/commands.json
@@ -10,8 +10,8 @@
},
{
"name": "ADCSmoother",
- "args": "Cmd_SetupADCSmoother",
- "descr": "",
+ "args": "[Pindex] [TotalSamples] [SampleIntervalMS] [TargetChannelADCValue] [MarginValue] [TargetChannel0or1]",
+ "descr": "Starts the ADC smoother with given configuration",
"fn": "NULL);",
"file": "driver/drv_adcSmoother.c",
"requires": "",
@@ -1549,8 +1549,8 @@
},
{
"name": "scanI2C",
- "args": "",
- "descr": "",
+ "args": "[Soft/I2C1/I2C2]",
+ "descr": "Scans given I2C line for addresses. I2C driver must be started first.",
"fn": "DRV_I2C_MCP23017_MapPinToChannel",
"file": "i2c/drv_i2c_main.c",
"requires": "",
diff --git a/src/driver/drv_adcSmoother.c b/src/driver/drv_adcSmoother.c
index cd71f72fe..a41b646f4 100644
--- a/src/driver/drv_adcSmoother.c
+++ b/src/driver/drv_adcSmoother.c
@@ -78,8 +78,8 @@ commandResult_t Cmd_SetupADCSmoother(const void* context, const char* cmd, const
void DRV_ADCSmoother_Init() {
- //cmddetail:{"name":"ADCSmoother","args":"Cmd_SetupADCSmoother",
- //cmddetail:"descr":"",
+ //cmddetail:{"name":"ADCSmoother","args":"[Pindex] [TotalSamples] [SampleIntervalMS] [TargetChannelADCValue] [MarginValue] [TargetChannel0or1]",
+ //cmddetail:"descr":"Starts the ADC smoother with given configuration",
//cmddetail:"fn":"NULL);","file":"driver/drv_adcSmoother.c","requires":"",
//cmddetail:"examples":""}
CMD_RegisterCommand("ADCSmoother", Cmd_SetupADCSmoother, NULL);
diff --git a/src/i2c/drv_i2c_main.c b/src/i2c/drv_i2c_main.c
index 4b6276ad5..b44240a7b 100644
--- a/src/i2c/drv_i2c_main.c
+++ b/src/i2c/drv_i2c_main.c
@@ -378,8 +378,8 @@ void DRV_I2C_Init()
//cmddetail:"fn":"DRV_I2C_MCP23017_MapPinToChannel","file":"i2c/drv_i2c_main.c","requires":"",
//cmddetail:"examples":""}
CMD_RegisterCommand("MCP23017_MapPinToChannel", DRV_I2C_MCP23017_MapPinToChannel, NULL);
- //cmddetail:{"name":"scanI2C","args":"",
- //cmddetail:"descr":"",
+ //cmddetail:{"name":"scanI2C","args":"[Soft/I2C1/I2C2]",
+ //cmddetail:"descr":"Scans given I2C line for addresses. I2C driver must be started first.",
//cmddetail:"fn":"DRV_I2C_MCP23017_MapPinToChannel","file":"i2c/drv_i2c_main.c","requires":"",
//cmddetail:"examples":""}
CMD_RegisterCommand("scanI2C", DRV_I2C_Scan, NULL);
diff --git a/src/new_cfg.c b/src/new_cfg.c
index b685ad491..fc5bf3595 100644
--- a/src/new_cfg.c
+++ b/src/new_cfg.c
@@ -287,6 +287,7 @@ int CFG_GetMQTTPort() {
return g_cfg.mqtt_port;
}
void CFG_SetShortDeviceName(const char *s) {
+
// this will return non-zero if there were any changes
if(strcpy_safe_checkForChanges(g_cfg.shortDeviceName, s,sizeof(g_cfg.shortDeviceName))) {
// mark as dirty (value has changed)