node-red-contrib-tuya-local
node-red-contrib-tuya-local copied to clipboard
ReferenceError: timeout is not defined
(node:63079) UnhandledPromiseRejectionWarning: ReferenceError: timeout is not defined
at TuyaDevice.
Try to update to the latest.
Any luck?
pls. add tag node-red to package.json, update version hard to install and update right now
The package is not yet published to npm. I’ll sort that out during the week. I need to make sure is working properly. Did you update the node to latest and is it working ?
node-red crashes at start
13 Aug 10:04:26 - [red] Uncaught Exception:
13 Aug 10:04:26 - TypeError: Cannot read property 'replace' of undefined
at filterCommandByte (/Users/apopov/.node-red/node_modules/node-red-contrib-tuya-local/lib/utils.js:48:18)
at TuyaDevice.
I cannot reproduce this, did just update? are you using the commandByte filter?
Just add extra check
function filterCommandByte(msg,cmd_bytes) {
if (!cmd_bytes) return null;
arr = cmd_bytes.replace(/\s/g,"").split(",");
arr = arr.map(function (x) {
return parseInt(x, 10);
});
return (arr.includes(msg.commandByte)) ? null : msg;
}
next issue is:
(node:73782) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '1' of undefined at /Users/apopov/.node-red/node_modules/node-red-contrib-tuya-local/node_modules/tuyapi/index.js:122:29 at processTicksAndRejections (internal/process/task_queues.js:89:5) (node:73782) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:73782) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The second error is tuyapi, nothing we can do there.
I cannot reproduce the first one, not an expert in this. What node version is this ?
node v12.4.0 node-red v0.20.7
Just tested with v12.4.0 and is working fine. Did you maybe duplicate the node with same ip address?