mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-27 19:57:38 +00:00
This commit is contained in:
@@ -26,6 +26,8 @@ Also there are more people on the forum that can help you with support.
|
||||
|
||||
* Incomplete or unstable plugins should have a PLUGIN_BUILD_DEV #ifdef around them. Also add [DEVELOPMENT] to the name.
|
||||
|
||||
* New plugins that seem to be working correctly should have a PLUGIN_BUILD_TESTING around until they are tested enough.
|
||||
* Do not modify any of the variables passed to your PLUGIN_WRITE handler.
|
||||
|
||||
* New plugins that seem to be working correctly should have a PLUGIN_BUILD_TESTING around until they are tested enough. Also add [TESTING] to the name
|
||||
|
||||
* Also see our general guidelines at: https://www.letscontrolit.com/wiki/index.php/ESPEasyDevelopmentGuidelines
|
||||
|
||||
+5
-5
@@ -1253,7 +1253,7 @@ void delayedReboot(int rebootDelay)
|
||||
#endif
|
||||
#if defined(ESP32)
|
||||
ESP.restart();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -2756,10 +2756,10 @@ void tone(uint8_t _pin, unsigned int frequency, unsigned long duration) {
|
||||
/********************************************************************************************\
|
||||
Play RTTTL string on specified pin
|
||||
\*********************************************************************************************/
|
||||
void play_rtttl(uint8_t _pin, char *p )
|
||||
void play_rtttl(uint8_t _pin, const char *p )
|
||||
{
|
||||
#define OCTAVE_OFFSET 0
|
||||
// Absolutely no error checking in here
|
||||
// FIXME: Absolutely no error checking in here
|
||||
|
||||
int notes[] = { 0,
|
||||
262, 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494,
|
||||
@@ -2943,7 +2943,7 @@ void ArduinoOTAInit()
|
||||
#endif
|
||||
#if defined(ESP32)
|
||||
ESP.restart();
|
||||
#endif
|
||||
#endif
|
||||
});
|
||||
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
|
||||
|
||||
@@ -2964,7 +2964,7 @@ void ArduinoOTAInit()
|
||||
#endif
|
||||
#if defined(ESP32)
|
||||
ESP.restart();
|
||||
#endif
|
||||
#endif
|
||||
});
|
||||
ArduinoOTA.begin();
|
||||
|
||||
|
||||
@@ -314,6 +314,7 @@ boolean Plugin_001(byte function, struct EventStruct *event, String& string)
|
||||
outputstate[event->Par1] = event->Par2;
|
||||
}
|
||||
|
||||
// FIXME: Absolutely no error checking in play_rtttl, until then keep it only in testing
|
||||
#ifdef PLUGIN_BUILD_TESTING
|
||||
//play a tune via a RTTTL string, look at https://www.letscontrolit.com/forum/viewtopic.php?f=4&t=343&hilit=speaker&start=10 for more info.
|
||||
if (command == F("rtttl"))
|
||||
@@ -322,10 +323,11 @@ boolean Plugin_001(byte function, struct EventStruct *event, String& string)
|
||||
if (event->Par1 >= 0 && event->Par1 <= 16)
|
||||
{
|
||||
pinMode(event->Par1, OUTPUT);
|
||||
char sng[1024] ="";
|
||||
string.replace("-","#");
|
||||
string.toCharArray(sng, 1024);
|
||||
play_rtttl(event->Par1, sng);
|
||||
// char sng[1024] ="";
|
||||
String tmpString=string;
|
||||
tmpString.replace("-","#");
|
||||
// tmpString.toCharArray(sng, 1024);
|
||||
play_rtttl(event->Par1, tmpString.c_str());
|
||||
setPinState(PLUGIN_ID_001, event->Par1, PIN_MODE_OUTPUT, event->Par2);
|
||||
log = String(F("SW : ")) + string;
|
||||
addLog(LOG_LEVEL_INFO, log);
|
||||
@@ -370,7 +372,7 @@ void analogWriteESP32(int pin, int value)
|
||||
for(byte x = 0; x < 16; x++)
|
||||
if (ledChannelPin[x] == pin)
|
||||
ledChannel = x;
|
||||
|
||||
|
||||
if(ledChannel == -1) // no channel set for this pin
|
||||
{
|
||||
for(byte x = 0; x < 16; x++) // find free channel
|
||||
@@ -387,4 +389,3 @@ void analogWriteESP32(int pin, int value)
|
||||
ledcWrite(ledChannel, value);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -134,8 +134,9 @@ boolean Plugin_054(byte function, struct EventStruct *event, String& string)
|
||||
|
||||
case PLUGIN_WRITE:
|
||||
{
|
||||
string.toLowerCase();
|
||||
String command = parseString(string, 1);
|
||||
String lowerString=string;
|
||||
lowerString.toLowerCase();
|
||||
String command = parseString(lowerString, 1);
|
||||
|
||||
if (command == F("dmx"))
|
||||
{
|
||||
@@ -146,11 +147,11 @@ boolean Plugin_054(byte function, struct EventStruct *event, String& string)
|
||||
int16_t channel = 1;
|
||||
int16_t value = 0;
|
||||
|
||||
string.replace(" ", " ");
|
||||
string.replace(" =", "=");
|
||||
string.replace("= ", "=");
|
||||
lowerString.replace(" ", " ");
|
||||
lowerString.replace(" =", "=");
|
||||
lowerString.replace("= ", "=");
|
||||
|
||||
param = parseString(string, paramIdx++);
|
||||
param = parseString(lowerString, paramIdx++);
|
||||
if (param.length())
|
||||
{
|
||||
while (param.length())
|
||||
@@ -211,7 +212,7 @@ boolean Plugin_054(byte function, struct EventStruct *event, String& string)
|
||||
channel++;
|
||||
}
|
||||
|
||||
param = parseString(string, paramIdx++);
|
||||
param = parseString(lowerString, paramIdx++);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
+12
-11
@@ -150,13 +150,14 @@ boolean Plugin_057(byte function, struct EventStruct *event, String& string)
|
||||
if (!Plugin_057_M)
|
||||
return false;
|
||||
|
||||
string.toLowerCase();
|
||||
String command = parseString(string, 1);
|
||||
String lowerString=string;
|
||||
lowerString.toLowerCase();
|
||||
String command = parseString(lowerString, 1);
|
||||
|
||||
if (command == F("mprint"))
|
||||
{
|
||||
int paramPos = getParamStartPos(string, 2);
|
||||
String text = string.substring(paramPos);
|
||||
int paramPos = getParamStartPos(lowerString, 2);
|
||||
String text = lowerString.substring(paramPos);
|
||||
byte seg = 0;
|
||||
|
||||
Plugin_057_M->ClearRowBuffer();
|
||||
@@ -171,8 +172,8 @@ boolean Plugin_057(byte function, struct EventStruct *event, String& string)
|
||||
success = true;
|
||||
}
|
||||
else if (command == F("mbr")) {
|
||||
int paramPos = getParamStartPos(string, 2);
|
||||
uint8_t brightness = string.substring(paramPos).toInt();
|
||||
int paramPos = getParamStartPos(lowerString, 2);
|
||||
uint8_t brightness = lowerString.substring(paramPos).toInt();
|
||||
Plugin_057_M->SetBrightness(brightness);
|
||||
success = true;
|
||||
}
|
||||
@@ -185,11 +186,11 @@ boolean Plugin_057(byte function, struct EventStruct *event, String& string)
|
||||
uint8_t seg = 0;
|
||||
uint16_t value = 0;
|
||||
|
||||
string.replace(" ", " ");
|
||||
string.replace(" =", "=");
|
||||
string.replace("= ", "=");
|
||||
lowerString.replace(" ", " ");
|
||||
lowerString.replace(" =", "=");
|
||||
lowerString.replace("= ", "=");
|
||||
|
||||
param = parseString(string, paramIdx++);
|
||||
param = parseString(lowerString, paramIdx++);
|
||||
if (param.length())
|
||||
{
|
||||
while (param.length())
|
||||
@@ -259,7 +260,7 @@ boolean Plugin_057(byte function, struct EventStruct *event, String& string)
|
||||
seg++;
|
||||
}
|
||||
|
||||
param = parseString(string, paramIdx++);
|
||||
param = parseString(lowerString, paramIdx++);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -121,9 +121,10 @@ boolean Plugin_065(byte function, struct EventStruct *event, String& string)
|
||||
if (!Plugin_065_SoftSerial)
|
||||
break;
|
||||
|
||||
string.toLowerCase();
|
||||
String command = parseString(string, 1);
|
||||
String param = parseString(string, 2);
|
||||
String lowerString=string;
|
||||
lowerString.toLowerCase();
|
||||
String command = parseString(lowerString, 1);
|
||||
String param = parseString(lowerString, 2);
|
||||
|
||||
if (command == F("play"))
|
||||
{
|
||||
|
||||
@@ -266,8 +266,9 @@ boolean Plugin_067(byte function, struct EventStruct *event, String& string)
|
||||
|
||||
case PLUGIN_WRITE:
|
||||
{
|
||||
string.toLowerCase();
|
||||
String command = parseString(string, 1);
|
||||
String lowerString=string;
|
||||
lowerString.toLowerCase();
|
||||
String command = parseString(lowerString, 1);
|
||||
|
||||
if (command == F("tare"))
|
||||
{
|
||||
|
||||
@@ -144,11 +144,12 @@ boolean Plugin_070(byte function, struct EventStruct *event, String& string)
|
||||
|
||||
case PLUGIN_WRITE:
|
||||
{
|
||||
string.toLowerCase();
|
||||
String command = parseString(string, 1);
|
||||
String param1 = parseString(string, 2);
|
||||
String param2 = parseString(string, 3);
|
||||
String param3 = parseString(string, 4);
|
||||
String lowerString=string;
|
||||
lowerString.toLowerCase();
|
||||
String command = parseString(lowerString, 1);
|
||||
String param1 = parseString(lowerString, 2);
|
||||
String param2 = parseString(lowerString, 3);
|
||||
String param3 = parseString(lowerString, 4);
|
||||
|
||||
if (command == F("clock")) {
|
||||
if (param1 != "") {
|
||||
|
||||
Reference in New Issue
Block a user