Skip to content

Commit

Permalink
docs refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
openshwprojects committed Sep 19, 2023
1 parent bc23304 commit 11d215b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/commands-extended.md
Original file line number Diff line number Diff line change
Expand Up @@ -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').<br/><br/>See also [AB_Map on forum](https://www.elektroda.com/rtvforum/find.php?q=AB_Map). | File: drv/drv_adcButton.c<br/>Function: Cmd_ADCButtonMap |
| ADCSmoother | Cmd_SetupADCSmoother | .<br/><br/>See also [ADCSmoother on forum](https://www.elektroda.com/rtvforum/find.php?q=ADCSmoother). | File: driver/drv_adcSmoother.c<br/>Function: NULL); |
| ADCSmoother | [Pindex] [TotalSamples] [SampleIntervalMS] [TargetChannelADCValue] [MarginValue] [TargetChannel0or1] | Starts the ADC smoother with given configuration.<br/><br/>See also [ADCSmoother on forum](https://www.elektroda.com/rtvforum/find.php?q=ADCSmoother). | File: driver/drv_adcSmoother.c<br/>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'.<br/><br/>See also [AddChangeHandler on forum](https://www.elektroda.com/rtvforum/find.php?q=AddChangeHandler). | File: cmnds/cmd_eventHandlers.c<br/>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.<br/><br/>See also [AddChannel on forum](https://www.elektroda.com/rtvforum/find.php?q=AddChannel). | File: cmnds/cmd_channels.c<br/>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.<br/><br/>See also [addClockEvent on forum](https://www.elektroda.com/rtvforum/find.php?q=addClockEvent). | File: driver/drv_ntp_events.c<br/>Function: CMD_NTP_AddClockEvent |
Expand Down Expand Up @@ -177,7 +177,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| restart | | Reboots the module.<br/><br/>See also [restart on forum](https://www.elektroda.com/rtvforum/find.php?q=restart). | File: cmnds/cmd_main.c<br/>Function: CMD_Restart |
| return | | Script-only command. Currently it just stops totally current script thread.<br/><br/>See also [return on forum](https://www.elektroda.com/rtvforum/find.php?q=return). | File: cmnds/cmd_script.c<br/>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.<br/><br/>See also [SafeMode on forum](https://www.elektroda.com/rtvforum/find.php?q=SafeMode). | File: cmnds/cmd_main.c<br/>Function: CMD_SafeMode |
| scanI2C | | .<br/><br/>See also [scanI2C on forum](https://www.elektroda.com/rtvforum/find.php?q=scanI2C). | File: i2c/drv_i2c_main.c<br/>Function: DRV_I2C_MCP23017_MapPinToChannel |
| scanI2C | [Soft/I2C1/I2C2] | Scans given I2C line for addresses. I2C driver must be started first.<br/><br/>See also [scanI2C on forum](https://www.elektroda.com/rtvforum/find.php?q=scanI2C). | File: i2c/drv_i2c_main.c<br/>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.<br/><br/>See also [scheduleHADiscovery on forum](https://www.elektroda.com/rtvforum/find.php?q=scheduleHADiscovery). | File: cmnds/cmd_main.c<br/>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.<br/><br/>See also [sendGet on forum](https://www.elektroda.com/rtvforum/find.php?q=sendGet). | File: cmnds/cmd_send.c<br/>Function: CMD_SendGET |
| sendPOST | [TargetURL] [HTTP Port] [Content Type] [Post Content] | Sends a HTTP POST request to target URL. Arguments can contain variable expansion.<br/><br/>See also [sendPOST on forum](https://www.elektroda.com/rtvforum/find.php?q=sendPOST). | File: cmnds/cmd_send.c<br/>Function: CMD_SendPOST |
Expand Down
4 changes: 2 additions & 2 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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').<br/><br/>See also [AB_Map on forum](https://www.elektroda.com/rtvforum/find.php?q=AB_Map). |
| ADCSmoother | Cmd_SetupADCSmoother | .<br/><br/>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.<br/><br/>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'.<br/><br/>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.<br/><br/>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.<br/><br/>See also [addClockEvent on forum](https://www.elektroda.com/rtvforum/find.php?q=addClockEvent). |
Expand Down Expand Up @@ -180,7 +180,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| restart | | Reboots the module.<br/><br/>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.<br/><br/>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.<br/><br/>See also [SafeMode on forum](https://www.elektroda.com/rtvforum/find.php?q=SafeMode). |
| scanI2C | | .<br/><br/>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.<br/><br/>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.<br/><br/>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.<br/><br/>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.<br/><br/>See also [sendPOST on forum](https://www.elektroda.com/rtvforum/find.php?q=sendPOST). |
Expand Down
8 changes: 4 additions & 4 deletions docs/json/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down
4 changes: 2 additions & 2 deletions src/driver/drv_adcSmoother.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/i2c/drv_i2c_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/new_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 11d215b

Please sign in to comment.