Skip to content

Commit

Permalink
Merge pull request #4 from letscontrolit/mega
Browse files Browse the repository at this point in the history
Update 20200308
  • Loading branch information
Micha-he authored Mar 9, 2020
2 parents e39d630 + b63ca29 commit db3d545
Show file tree
Hide file tree
Showing 19 changed files with 266 additions and 59 deletions.
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ script:
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_IRext_ESP8266_4M2M
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_242_ESP8266_1M_OTA
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_242_ESP8285_1M_OTA
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_261_ESP8266_1M_OTA
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_261_ESP8285_1M_OTA
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_261_sdk3_ESP8266_1M_OTA
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_261_sdk3_ESP8285_1M_OTA
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_263_ESP8266_1M_OTA_Domoticz
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_263_ESP8266_1M_OTA_FHEM_HA
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_263_ESP8285_1M_OTA_Domoticz
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_263_ESP8285_1M_OTA_FHEM_HA
#- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_263_sdk3_ESP8266_1M_OTA_Domoticz
#- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_263_sdk3_ESP8266_1M_OTA_FHEM_HA
#- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_263_sdk3_ESP8285_1M_OTA_Domoticz
#- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e minimal_core_263_sdk3_ESP8285_1M_OTA_FHEM_HA
#- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_ESP8266_16M
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_ESP8266_1M
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e normal_ESP8266_1M_VCC
Expand Down
14 changes: 14 additions & 0 deletions docs/source/Plugin/P000_commands.repl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@

``ControllerEnable,<controller nr>``"
"
DateTime","
:red:`Internal`","
Get or set the date and time (optional).

Usage: ``Datetime[,YYYY-MM-DD[,hh:mm:ss]]``

Examples:

* ``Datetime,2020-02-29,00:23:00``
* ``Datetime,2020-02-29`` - set node time '2020-02-29 00:00:00'
* ``Datetime`` - get current node time

Time source will be set to ``Manual_set`` until the time will be updated via another source. (e.g. GPS or NTP)
"
Debug","
:red:`Internal`","
Change Serial port debug level
Expand Down
1 change: 1 addition & 0 deletions docs/source/Rules/Rules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ Floating point transformations:
* ``Dx.y``: Minimal 'x' digits zero filled & 'y' decimal fixed digits. E.g. ``[bme#T#D2.1]``
* ``Dx``: Minimal 'x' digits zero filled in front of the decimal point, no decimal digits. Same as ``Dx.0``
* ``D.y``: Same as ``D0.y``
* ``d``: Same as ``D`` but spaces insted zeros
* ``F``: Floor (round down)
* ``E``: cEiling (round up)

Expand Down
2 changes: 1 addition & 1 deletion platformio_core_defs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ platform = espressif8266@2.3.2
platform_packages =
framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git#2.6.3
build_flags = ${esp82xx_2_6_x.build_flags}
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191122

[core_2_6_3_sdk3]
platform = espressif8266@2.3.2
Expand Down
51 changes: 47 additions & 4 deletions platformio_esp82xx_envs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ build_flags = ${regular_platform.build_flags}
; Minimal build size for OTA ;
; *********************************************************************

[minimal_OTA_domoticz]
build_flags = -DUSES_DOMOTICZ

[minimal_OTA_FHEM_HA]
build_flags = -DUSES_FHEM
-DUSES_HOMEASSISTANT_OPENHAB


[env:minimal_core_242_ESP8266_1M_OTA]
extends = esp8266_1M_OTA
platform = ${core_2_4_2.platform}
Expand All @@ -157,31 +165,66 @@ platform = ${core_2_4_2.platform}
build_flags = ${core_2_4_2.build_flags}
${esp8285_1M_OTA.build_flags}

[env:minimal_core_261_ESP8266_1M_OTA]
[env:minimal_core_263_ESP8266_1M_OTA_Domoticz]
extends = esp8266_1M_OTA
platform = ${regular_platform.platform}
platform_packages = ${regular_platform.platform_packages}
build_flags = ${regular_platform.build_flags}
${esp8266_1M_OTA.build_flags}
${minimal_OTA_domoticz.build_flags}

[env:minimal_core_263_ESP8285_1M_OTA_Domoticz]
extends = esp8285_1M_OTA
platform = ${regular_platform.platform}
platform_packages = ${regular_platform.platform_packages}
build_flags = ${regular_platform.build_flags}
${esp8285_1M_OTA.build_flags}
${minimal_OTA_domoticz.build_flags}

[env:minimal_core_263_sdk3_ESP8266_1M_OTA_Domoticz]
extends = esp8266_1M_OTA
platform = ${core_2_6_3_sdk3.platform}
build_flags = ${core_2_6_3_sdk3.build_flags}
${esp8266_1M_OTA.build_flags}
${minimal_OTA_domoticz.build_flags}

[env:minimal_core_263_sdk3_ESP8285_1M_OTA_Domoticz]
extends = esp8285_1M_OTA
platform = ${core_2_6_3_sdk3.platform}
build_flags = ${core_2_6_3_sdk3.build_flags}
${esp8285_1M_OTA.build_flags}
${minimal_OTA_domoticz.build_flags}


[env:minimal_core_263_ESP8266_1M_OTA_FHEM_HA]
extends = esp8266_1M_OTA
platform = ${regular_platform.platform}
platform_packages = ${regular_platform.platform_packages}
build_flags = ${regular_platform.build_flags}
${esp8266_1M_OTA.build_flags}
${minimal_OTA_FHEM_HA.build_flags}

[env:minimal_core_261_ESP8285_1M_OTA]
[env:minimal_core_263_ESP8285_1M_OTA_FHEM_HA]
extends = esp8285_1M_OTA
platform = ${regular_platform.platform}
platform_packages = ${regular_platform.platform_packages}
build_flags = ${regular_platform.build_flags}
${esp8285_1M_OTA.build_flags}
${minimal_OTA_FHEM_HA.build_flags}

[env:minimal_core_261_sdk3_ESP8266_1M_OTA]
[env:minimal_core_263_sdk3_ESP8266_1M_OTA_FHEM_HA]
extends = esp8266_1M_OTA
platform = ${core_2_6_3_sdk3.platform}
build_flags = ${core_2_6_3_sdk3.build_flags}
${esp8266_1M_OTA.build_flags}
${minimal_OTA_FHEM_HA.build_flags}

[env:minimal_core_261_sdk3_ESP8285_1M_OTA]
[env:minimal_core_263_sdk3_ESP8285_1M_OTA_FHEM_HA]
extends = esp8285_1M_OTA
platform = ${core_2_6_3_sdk3.platform}
build_flags = ${core_2_6_3_sdk3.build_flags}
${esp8285_1M_OTA.build_flags}
${minimal_OTA_FHEM_HA.build_flags}



Expand Down
16 changes: 15 additions & 1 deletion src/Command.ino
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ bool executeInternalCommand(const char *cmd, struct EventStruct *event, const ch
break;
}
case 'b': {
#ifndef BUILD_NO_DIAGNOSTIC_COMMANDS
COMMAND_CASE("background", Command_Background, 1); // Diagnostic.h
#endif
#ifdef USES_C012
COMMAND_CASE( "blynkget", Command_Blynk_Get, -1);
#endif // ifdef USES_C012
Expand All @@ -142,6 +144,7 @@ bool executeInternalCommand(const char *cmd, struct EventStruct *event, const ch
break;
}
case 'd': {
COMMAND_CASE( "datetime", Command_DateTime, 2); // Time.h
COMMAND_CASE( "debug", Command_Debug, 1); // Diagnostic.h
COMMAND_CASE("deepsleep", Command_System_deepSleep, 1); // System.h
COMMAND_CASE( "delay", Command_Delay, 1); // Timers.h
Expand All @@ -165,20 +168,27 @@ bool executeInternalCommand(const char *cmd, struct EventStruct *event, const ch
break;
}
case 'j': {
#ifndef BUILD_NO_DIAGNOSTIC_COMMANDS
COMMAND_CASE("jsonportstatus", Command_JSONPortStatus, -1); // Diagnostic.h
#endif
break;
}
case 'l': {
COMMAND_CASE( "let", Command_Rules_Let, 2); // Rules.h
COMMAND_CASE( "load", Command_Settings_Load, 0); // Settings.h
COMMAND_CASE( "logentry", Command_logentry, 1); // Diagnostic.h
#ifndef BUILD_NO_DIAGNOSTIC_COMMANDS
COMMAND_CASE("logportstatus", Command_logPortStatus, 0); // Diagnostic.h
COMMAND_CASE( "lowmem", Command_Lowmem, 0); // Diagnostic.h
#endif
break;
}
case 'm': {
#ifndef BUILD_NO_DIAGNOSTIC_COMMANDS
COMMAND_CASE( "malloc", Command_Malloc, 1); // Diagnostic.h
COMMAND_CASE( "meminfo", Command_MemInfo, 0); // Diagnostic.h
COMMAND_CASE( "meminfodetail", Command_MemInfo_detail, 0); // Diagnostic.h
#endif
#ifdef USES_MQTT
COMMAND_CASE( "messagedelay", Command_MQTT_messageDelay, 1); // MQTT.h
COMMAND_CASE("mqttretainflag", Command_MQTT_Retain, 1); // MQTT.h
Expand Down Expand Up @@ -218,14 +228,18 @@ bool executeInternalCommand(const char *cmd, struct EventStruct *event, const ch
// arguments?
COMMAND_CASE( "sendtohttp", Command_HTTP_SendToHTTP, 3); // HTTP.h
COMMAND_CASE( "sendtoudp", Command_UDP_SendToUPD, 3); // UDP.h
#ifndef BUILD_NO_DIAGNOSTIC_COMMANDS
COMMAND_CASE("serialfloat", Command_SerialFloat, 0); // Diagnostic.h
#endif
COMMAND_CASE( "settings", Command_Settings_Print, 0); // Settings.h
}
COMMAND_CASE( "subnet", Command_Subnet, 1); // Network Command
#ifdef USES_MQTT
COMMAND_CASE( "subscribe", Command_MQTT_Subscribe, 1); // MQTT.h
COMMAND_CASE( "subscribe", Command_MQTT_Subscribe, 1); // MQTT.h
#endif // USES_MQTT
#ifndef BUILD_NO_DIAGNOSTIC_COMMANDS
COMMAND_CASE( "sysload", Command_SysLoad, 0); // Diagnostic.h
#endif
break;
}
case 't': {
Expand Down
2 changes: 1 addition & 1 deletion src/ESPEasy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
#include "src/Globals/MQTT.h"
#include "src/Globals/Plugins.h"
#include "src/Globals/Protocol.h"
#include "src/Globals/RamTracker.h"
#include "src/Globals/RTC.h"
#include "src/Globals/SecuritySettings.h"
#include "src/Globals/Services.h"
Expand Down Expand Up @@ -878,7 +879,6 @@ void logTimerStatistics() {
\*********************************************************************************************/
void runEach30Seconds()
{
extern void checkRAMtoLog();
checkRAMtoLog();
wdcounter++;
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
Expand Down
14 changes: 14 additions & 0 deletions src/ESPEasyRules.ino
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,29 @@ void parse_string_commands(String &line) {
uint8_t uval = arg1.c_str()[0];
replacement = String(uval);
}
if (replacement.length() == 0) {
// part in braces is not a supported command.
// replace the {} with other characters to mask the braces so we can continue parsing.
// We have to unmask then after we're finished.
// See: https://github.com/letscontrolit/ESPEasy/issues/2932#issuecomment-596139096
replacement = line.substring(startIndex, closingIndex + 1);
replacement.replace('{', static_cast<char>(0x02));
replacement.replace('}', static_cast<char>(0x03));
}
// Replace the full command including opening and closing brackets.
line.replace(line.substring(startIndex, closingIndex + 1), replacement);

/*
if (replacement.length() > 0) {
addLog(LOG_LEVEL_INFO, String(F("parse_string_commands cmd: ")) + fullCommand + String(F(" -> ")) + replacement);
}
*/
}
}
// We now have to check if we did mask some parts and unmask them.
// Let's hope we don't mess up any Unicode here.
line.replace(static_cast<char>(0x02), '{');
line.replace(static_cast<char>(0x03), '}');
}


Expand Down
3 changes: 2 additions & 1 deletion src/ESPEasyTimeTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ enum timeSource_t {
No_time_source,
NTP_time_source,
Restore_RTC_time_source,
GPS_time_source
GPS_time_source,
Manual_set
};


Expand Down
3 changes: 2 additions & 1 deletion src/Misc.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1926,6 +1926,7 @@ void transformValue(
value = logicVal == 0 ? "0" : "1";
break;
case 'D' ://Dx.y min 'x' digits zero filled & 'y' decimal fixed digits
case 'd' ://like above but with spaces padding
{
int x;
int y;
Expand Down Expand Up @@ -1963,7 +1964,7 @@ void transformValue(
indexDot = value.length();
}
for (byte f = 0; f < (x - indexDot); f++) {
value = "0" + value;
value = (tempValueFormat[0]=='d'? ' ' : '0') + value;
}
break;
}
Expand Down
56 changes: 51 additions & 5 deletions src/define_plugin_sets.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,32 @@ To create/register a plugin, you have to :
#endif

#ifdef PLUGIN_BUILD_MINIMAL_IR
#ifndef USES_DOMOTICZ
#define USES_DOMOTICZ
#endif
#ifndef USES_FHEM
#define USES_FHEM
#endif
#ifndef USES_HOMEASSISTANT_OPENHAB
#define USES_HOMEASSISTANT_OPENHAB
#endif

#define PLUGIN_BUILD_MINIMAL_OTA
#define PLUGIN_DESCR "Minimal, IR"
#define PLUGIN_BUILD_IR
#endif

#ifdef PLUGIN_BUILD_MINIMAL_IRext
#ifndef USES_DOMOTICZ
#define USES_DOMOTICZ
#endif
#ifndef USES_FHEM
#define USES_FHEM
#endif
#ifndef USES_HOMEASSISTANT_OPENHAB
#define USES_HOMEASSISTANT_OPENHAB
#endif

#define PLUGIN_BUILD_MINIMAL_OTA
#define PLUGIN_DESCR "Minimal, IR with AC"
#define PLUGIN_BUILD_IR_EXTENDED
Expand Down Expand Up @@ -212,6 +232,19 @@ To create/register a plugin, you have to :
#endif
#endif

#ifdef USES_DOMOTICZ
#define USES_C001 // Domoticz HTTP
#define USES_C002 // Domoticz MQTT
#endif

#ifdef USES_FHEM
#define USES_C009 // FHEM HTTP
#endif

#ifdef USES_HOMEASSISTANT_OPENHAB
#define USES_C005 // Home Assistant (openHAB) MQTT
#endif

#ifdef PLUGIN_BUILD_MINIMAL_OTA
#ifndef PLUGIN_DESCR
#define PLUGIN_DESCR "Minimal 1M OTA"
Expand All @@ -224,12 +257,12 @@ To create/register a plugin, you have to :
#define BUILD_NO_DEBUG
#endif

#define USES_C001 // Domoticz HTTP
#define USES_C002 // Domoticz MQTT
#define USES_C005 // Home Assistant (openHAB) MQTT
// #define USES_C001 // Domoticz HTTP
// #define USES_C002 // Domoticz MQTT
// #define USES_C005 // Home Assistant (openHAB) MQTT
// #define USES_C006 // PiDome MQTT
#define USES_C008 // Generic HTTP
#define USES_C009 // FHEM HTTP
// #define USES_C009 // FHEM HTTP
// #define USES_C010 // Generic UDP
#define USES_C013 // ESPEasy P2P network

Expand Down Expand Up @@ -959,7 +992,9 @@ To create/register a plugin, you have to :
#endif

#if defined(USES_C001) || defined (USES_C002) || defined(USES_P029)
#define USES_DOMOTICZ
#ifndef USES_DOMOTICZ
#define USES_DOMOTICZ
#endif
#endif

#if defined(USES_C002) || defined (USES_C005) || defined(USES_C006) || defined(USES_C014) || defined(USES_P037)
Expand Down Expand Up @@ -1006,4 +1041,15 @@ To create/register a plugin, you have to :
#endif


#ifdef BUILD_NO_DEBUG
#ifndef BUILD_NO_DIAGNOSTIC_COMMANDS
#define BUILD_NO_DIAGNOSTIC_COMMANDS
#endif
#ifndef BUILD_NO_RAM_TRACKER
#define BUILD_NO_RAM_TRACKER
#endif

#endif


#endif // DEFINE_PLUGIN_SETS_H
Loading

0 comments on commit db3d545

Please sign in to comment.