mirror of
https://github.com/lasthead0/yandex2mqtt.git
synced 2025-08-08 01:00:31 +03:00
c
This commit is contained in:
24
app.js
24
app.js
@@ -112,6 +112,30 @@ global.mqttClient = mqtt.connect(`mqtt://${config.mqtt.host}`, {
|
||||
ldevice.updateState(`${message}`, instance);
|
||||
|
||||
/* */
|
||||
const req = https.request({
|
||||
hostname: 'dialogs.yandex.net',
|
||||
port: 443,
|
||||
path: `/api/v1/skills/${config.notification.skill_id}/callback/state`,
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': config.notification.oauth_token
|
||||
}
|
||||
}, res => {
|
||||
console.log(`statusCode: ${res.statusCode}`)
|
||||
|
||||
res.on('data', d => {
|
||||
process.stdout.write(d);
|
||||
});
|
||||
});
|
||||
|
||||
req.on('error', error => {
|
||||
console.error(error)
|
||||
});
|
||||
|
||||
req.write(data);
|
||||
req.end();
|
||||
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
|
Reference in New Issue
Block a user