mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
parent
550b8c5307
commit
143cfdd4f2
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user