diff --git a/CHANGELOG.md b/CHANGELOG.md index fab5f090d..2552d70a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file. - Berry `webserver.remove_route` to revert `webserver.on` (#23452) - Berry `compile` and `tasmota.compile` option to compile in local context (#23457) - Support for AP33772S USB PD Sink Controller as used in CentyLab RotoPD +- Berry mqtt publish rule processing ### Breaking Changed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index c6be100fc..873153e0b 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -127,6 +127,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - WebUI heap status [#23356](https://github.com/arendst/Tasmota/issues/23356) - Optional Wifi strength indicator in WebUI status line [#23352](https://github.com/arendst/Tasmota/issues/23352) - Wireguard VPN [#23347](https://github.com/arendst/Tasmota/issues/23347) +- Berry mqtt publish rule processing - Berry support for `sortedmap` [#23441](https://github.com/arendst/Tasmota/issues/23441) - Berry `introspect.module` option to not cache module entry [#23451](https://github.com/arendst/Tasmota/issues/23451) - Berry `webserver.remove_route` to revert `webserver.on` [#23452](https://github.com/arendst/Tasmota/issues/23452) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino b/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino index dae5cfd95..b9580911f 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino @@ -869,14 +869,14 @@ String RuleLoadFile(const char* fname) { /*******************************************************************************************/ -bool RulesProcessEvent(const char *json_event) -{ +bool RulesProcessEvent(const char *json_event) { #ifdef USE_BERRY // events are passed to Berry before Rules engine callBerryRule(json_event, Rules.teleperiod); #endif // USE_BERRY if (Rules.busy) { return false; } + if (!strlen(json_event)) { return true; } Rules.busy = true; bool serviced = false; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_mqtt.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_mqtt.ino index 6cb6c4e2e..53e692975 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_mqtt.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_mqtt.ino @@ -63,6 +63,9 @@ extern "C" { be_pop(vm, be_top(vm)); // clear stack to avoid any indirect warning message in subsequent calls to Berry MqttPublishPayload(topic, payload, is_binary ? len : 0 /*if string don't send length*/, retain); + if (!is_binary) { + XdrvRulesProcess(0, payload); // Process rules on berry publish + } be_return_nil(vm); // Return }