v5.12.0l - Increase rules save area to 511 chars

5.12.0l
 * Release rules up to 511 characters
 * Prepare for feature
release - call on translators to update their language files
This commit is contained in:
Theo Arends 2018-04-14 14:39:16 +02:00
parent 2b196bb524
commit 946fcd2fe4
7 changed files with 33 additions and 17 deletions

View File

@ -1,7 +1,19 @@
## Sonoff-Tasmota
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.
Current version is **5.12.0k** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
Alternative firmware for _ESP8266 based devices_ like [iTead](https://www.itead.cc/) _**Sonoff**_ with **web**, **timers**, 'Over The Air' (**OTA**) firmware updates and **sensors support**, allowing control under **Serial**, **HTTP** and **MQTT**, so as to be used on **Smart Home Systems**. Written for Arduino IDE and PlatformIO.
[![GitHub version](https://img.shields.io/github/release/arendst/Sonoff-Tasmota.svg)](https://github.com/arendst/Sonoff-Tasmota/releases/latest)
[![GitHub download](https://img.shields.io/github/downloads/arendst/Sonoff-Tasmota/total.svg)](https://github.com/arendst/Sonoff-Tasmota/releases/latest)
[![License](https://img.shields.io/github/license/arendst/Sonoff-Tasmota.svg)](https://github.com/arendst/Sonoff-Tasmota/blob/development/LICENSE.txt)
If you like **Sonoff Tasmota**, give it a star, or fork it and contribute!
[![GitHub stars](https://img.shields.io/github/stars/arendst/Sonoff-Tasmota.svg?style=social&label=Star)](https://github.com/arendst/Sonoff-Tasmota/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/arendst/Sonoff-Tasmota.svg?style=social&label=Fork)](https://github.com/arendst/Sonoff-Tasmota/network)
### Development:
[![Build Status](https://img.shields.io/travis/arendst/Sonoff-Tasmota.svg)](https://travis-ci.org/arendst/Sonoff-Tasmota)
Current version is **5.12.0l** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
### Quick install

View File

@ -1,4 +1,8 @@
/* 5.12.0k
/* 5.12.0l
* Release rules up to 511 characters
* Prepare for feature release - call on translators to update their language files
*
* 5.12.0k
* Prepare for simple rules of up to 255 characters by enlarging Settings area to now 2048 bytes
* Change Timer parameter name from Power to Action
* Add commands Publish, Rule, RuleTimer and Event. See Wiki about Rule restriction, usage and examples

View File

@ -49,7 +49,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
uint32_t no_power_on_check : 1; // bit 21 (v5.11.1i)
uint32_t mqtt_serial : 1; // bit 22 (v5.12.0f)
uint32_t rules_enabled : 1; // bit 23 (v5.12.0j)
uint32_t rules_once : 1; // bit 23 (v5.12.0k)
uint32_t rules_once : 1; // bit 24 (v5.12.0k)
uint32_t spare25 : 1;
uint32_t spare26 : 1;
uint32_t spare27 : 1;
@ -258,9 +258,9 @@ struct SYSCFG {
byte free_6b8[72]; // 6B8
char rules[MAX_RULE_SIZE]; // 700
char rules[MAX_RULE_SIZE]; // 700 uses 512 bytes in v5.12.0l
// 800 - FFF free locations
// 900 - FFF free locations
} Settings;
struct RTCMEM {

View File

@ -48,7 +48,7 @@ typedef unsigned long power_t; // Power (Relay) type
#define MAX_FRIENDLYNAMES 4 // Max number of Friendly names
#define MAX_DOMOTICZ_IDX 4 // Max number of Domoticz device, key and switch indices
#define MAX_DOMOTICZ_SNS_IDX 12 // Max number of Domoticz sensors indices
#define MAX_RULE_SIZE 256 // Max number of characters in rules
#define MAX_RULE_SIZE 512 // Max number of characters in rules
#define MODULE SONOFF_BASIC // [Module] Select default model
@ -86,10 +86,10 @@ typedef unsigned long power_t; // Power (Relay) type
#define SERIALLOG_TIMER 600 // Seconds to disable SerialLog
#define OTA_ATTEMPTS 5 // Number of times to try fetching the new firmware
#define INPUT_BUFFER_SIZE 255 // Max number of characters in (serial) command buffer
#define INPUT_BUFFER_SIZE 512 // Max number of characters in (serial and http) command buffer
#define CMDSZ 24 // Max number of characters in command
#define TOPSZ 100 // Max number of characters in topic string
#define LOGSZ 400 // Max number of characters in log
#define LOGSZ 512 // Max number of characters in log
#define MIN_MESSZ 893 // Min number of characters in MQTT message
#ifdef USE_MQTT_TLS

View File

@ -25,7 +25,7 @@
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
====================================================*/
#define VERSION 0x050C000B // 5.12.0k
#define VERSION 0x050C000C // 5.12.0l
// Location specific includes
#include <core_version.h> // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0)

View File

@ -1593,10 +1593,10 @@ void AddLog_P(byte loglevel, const char *formatP, const char *formatP2)
AddLog(loglevel);
}
void AddLogSerial(byte loglevel, uint8_t *buffer, byte count)
void AddLogSerial(byte loglevel, uint8_t *buffer, int count)
{
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_SERIAL D_RECEIVED));
for (byte i = 0; i < count; i++) {
for (int i = 0; i < count; i++) {
snprintf_P(log_data, sizeof(log_data), PSTR("%s %02X"), log_data, *(buffer++));
}
AddLog(loglevel);

View File

@ -40,10 +40,10 @@
* on rules#timer=1 do color 080800 endon
* on mqtt#connected do color 000010 endon on mqtt#disconnected do color 001010 endon on time#initialized do color 001000 endon on time#set do backlog color 000810;ruletimer1 10 endon on rules#timer=1 do color 080800 endon
* on event#anyname do color 100000 endon
* on event#anyname do color %eventvalue% endon
* on event#anyname do color %value% endon
* on power1#state=1 do color 001000 endon
* on button1#state do publish cmnd/ring2/power %eventvalue% endon on button2#state do publish cmnd/strip1/power %eventvalue% endon
* on switch1#state do power2 %eventvalue% endon
* on button1#state do publish cmnd/ring2/power %value% endon on button2#state do publish cmnd/strip1/power %value% endon
* on switch1#state do power2 %value% endon
*
* Notes:
* Spaces after <on>, around <do> and before <endon> are mandatory
@ -185,7 +185,7 @@ bool RulesRuleMatch(String &event, String &rule)
if (!root[rule_task][rule_name].success()) return false;
// No value but rule_name is ok
rules_event_value = str_value; // Prepare %eventvalue%
rules_event_value = str_value; // Prepare %value%
// Step 3: Compare rule (value)
if (str_value) {
@ -260,7 +260,7 @@ bool RulesProcess()
rules_event_value = "";
String event = event_saved;
if (RulesRuleMatch(event, event_trigger)) {
commands.replace(F("%eventvalue%"), rules_event_value);
commands.replace(F("%value%"), rules_event_value);
char command[commands.length() +1];
snprintf(command, sizeof(command), commands.c_str());