From dec96a9a4e671057a13efd27ef1349275f2c37c5 Mon Sep 17 00:00:00 2001 From: Evgenii Abramov Date: Tue, 30 Mar 2021 00:41:52 +0300 Subject: [PATCH] test --- app.js | 59 ++++++++++++++++++++++++++-------------------------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/app.js b/app.js index 8f3600c..ca5b8de 100644 --- a/app.js +++ b/app.js @@ -112,39 +112,32 @@ global.mqttClient = mqtt.connect(`mqtt://${config.mqtt.host}`, { ldevice.updateState(`${message}`, instance); /* */ - if (config.yandex != undefined) { - const {skillId, token} = config.yandex; - const noticeRequest = https.request({ - hostname: 'dialogs.yandex.net', - port: 443, - path: `/api/v1/skills/${skillId}/callback/state`, - method: 'POST', - headers: { - 'Authorization': token, - 'Content-Type': 'application/json' - } - }, res => { - res.on('data', d => { - console.log(d); - }); - res.on('error', err => { - console.log(err); - }) - }); - const st = ldevice.getState(); - noticeRequest.write(JSON.stringify({ - ts: Math.floor(Date.now() / 1000), - payload: { - user_id: "1", - devices: [{ - id: deviceId, - capabilities: st.capabilities, - properties: st.properties - }] - } - })); - noticeRequest.end(); - } + // if (config.yandex != undefined) { + // const {skillId, token} = config.yandex; + // const noticeRequest = https.request({ + // hostname: 'dialogs.yandex.net', + // port: 443, + // path: `/api/v1/skills/${skillId}/callback/state`, + // method: 'POST', + // headers: { + // 'Authorization': token, + // 'Content-Type': 'application/json' + // } + // }); + // const st = ldevice.getState(); + // noticeRequest.write(JSON.stringify({ + // ts: Math.floor(Date.now() / 1000), + // payload: { + // user_id: "1", + // devices: [{ + // id: deviceId, + // capabilities: st.capabilities, + // properties: st.properties + // }] + // } + // })); + // noticeRequest.end(); + // } /* */ });