shelly-script-examples
shelly-script-examples copied to clipboard
Error on script ble-pasv-mqtt-gw with code for 'h' decode
Describe the bug I have an error when run script on line 123 for decode 'h' info. When i comment this line "res[keyArr[pos]] = le ? this.getInt16LE() : this.getInt16BE();" no issue.
A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- Run script
- After a few second
- See error
Uncaught Error: Too much recursion - the stack is about to overflow
at 0xffff & (this.buffer.at(1) << 8 | this.buffer.at(0));
^
in function "getUInt16LE" called from this.utoi(this.getUInt16LE());
^
in function "getInt16LE" called from ...s]] = le ? this.getInt16LE() : this.getInt16BE();
^
in function "unpack" called from ... ['temperature','humidity']);
^
in funct...
Expected behavior No error when script running
Device and script details (please complete the following information):
- Device 1 PLUS PM 2 GEN
- Firmware 1.6.1
- https://github.com/ALLTERCO/shelly-script-examples/blob/main/ble-pasv-mqtt-gw.js
Additional context I tried to debug this line but console log no show me any information on this script so I don't understand what happen on this line.