node-red
Closed this issue · 2 comments
Am trying to use this module in a node-red function, could you update the doc for a (stop or close) to not keep them open after gets.
keepAlive: false & closeOnExit: false have no effect.
exports.defaultOptions = {
hostname: 'mediation.tydom.com',
userAgent: env_1.USER_AGENT,
keepAlive: false,
closeOnExit: false,
requestTimeout: 5 * 1000,
keepAliveInterval: 30 * 1000,
followUpDebounce: 400
};
node-red function
const tydomClient = global.get('tydomclient');
const {createClient} = tydomClient;
const username = '0000210161E1';
const password = 'Testing';
const hostname = '192.168.1.4';
const client = createClient({username, password, hostname});
(async () => {
var socket = await client.connect();
var payload = JSON.stringify(await client.get('/devices/data'));
msg.payload = payload;
node.send(msg);
node.done();
})();
return;
Thanks a lots !
Just use client.close();
, see https://github.com/mgcrea/node-tydom-client/blob/master/src/client.ts#L202
Am trying to use this module in a node-red function, could you update the doc for a (stop or close) to not keep them open after gets.
keepAlive: false & closeOnExit: false have no effect.
exports.defaultOptions = { hostname: 'mediation.tydom.com', userAgent: env_1.USER_AGENT, keepAlive: false, closeOnExit: false, requestTimeout: 5 * 1000, keepAliveInterval: 30 * 1000, followUpDebounce: 400 };
node-red function
const tydomClient = global.get('tydomclient'); const {createClient} = tydomClient; const username = '0000210161E1'; const password = 'Testing'; const hostname = '192.168.1.4'; const client = createClient({username, password, hostname}); (async () => { var socket = await client.connect(); var payload = JSON.stringify(await client.get('/devices/data')); msg.payload = payload; node.send(msg); node.done(); })(); return;
Thanks a lots !
Hello, i am trying to use this library in node-red, but i am not sure how to use it.
You seem to successfully integrated it.
Can you post more details about your configuration and use please ?