diff --git a/CHANGELOG.md b/CHANGELOG.md index f8c71c321..c68a179c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file. - Berry vulnerability in JSON parsing for unicode - Berry fix security issues in `int64` and improve documentation - Berry fix security issues in `berry_mapping` and improve documentation +- Berry Hue fix regression from #23429 ### Removed diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_hue.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_hue.ino index 2ea37e61c..17308dcb2 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_hue.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_hue.ino @@ -51,8 +51,9 @@ bool be_hue_status(String* response, uint32_t device_id) { return handled; } // AddLog(LOG_LEVEL_DEBUG_MORE, ">be_hue_status response='%s' device_id=%i", response->c_str(), device_id); + be_pop(vm, 1); } - be_pop(vm, 2); + be_pop(vm, 1); return false; } @@ -70,6 +71,7 @@ void be_hue_discovery(String* response, bool* appending) { int32_t ret = be_pcall(vm, 1); // 2 params: self if (ret != 0) { be_error_pop_all(vm); // clear Berry stack + return; } be_pop(vm, 1); if (be_isstring(vm, -1)) { @@ -81,8 +83,9 @@ void be_hue_discovery(String* response, bool* appending) { } } // AddLog(LOG_LEVEL_DEBUG_MORE, ">be_hue_discovery"); + be_pop(vm, 1); } - be_pop(vm, 2); + be_pop(vm, 1); } // Groups command, list all ids prefixed by ',', ex: ",11,23" @@ -98,6 +101,7 @@ void be_hue_groups(String* response) { int32_t ret = be_pcall(vm, 1); // 2 params: self if (ret != 0) { be_error_pop_all(vm); // clear Berry stack + return; } be_pop(vm, 1); if (be_isstring(vm, -1)) { @@ -106,8 +110,9 @@ void be_hue_groups(String* response) { *response += buf; } } + be_pop(vm, 1); } - be_pop(vm, 2); + be_pop(vm, 1); } // handle incoming command @@ -130,6 +135,7 @@ bool be_hue_command(uint8_t device, uint32_t device_id, String* response) { int32_t ret = be_pcall(vm, 3); // 2 params: self, id, args if (ret != 0) { be_error_pop_all(vm); // clear Berry stack + return false; } be_pop(vm, 3); if (be_isstring(vm, -1)) { @@ -141,8 +147,9 @@ bool be_hue_command(uint8_t device, uint32_t device_id, String* response) { return handled; } // AddLog(LOG_LEVEL_DEBUG_MORE, ">be_hue_status response='%s' device_id=%i", response->c_str(), device_id); + be_pop(vm, 1); } - be_pop(vm, 2); + be_pop(vm, 1); return false; } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino index c891a62ee..ef5c8cc97 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino @@ -80,6 +80,10 @@ const char be_berry_init_code[] = "import light " #endif // USE_LIGHT +#if defined(USE_EMULATION) && defined(USE_EMULATION_HUE) + "import hue_bridge " +#endif + "do import tapp end " // we don't need to keep `tapp` in the global namespace #ifdef USE_BERRY_DEBUG