node-red-contrib-yandex-station-management
Advanced tools
Comparing version 0.3.8 to 0.3.9
@@ -298,3 +298,3 @@ var rp = require('request-promise'); | ||
}, 10000); | ||
device.pingInterval = setInterval(onPing,300,device); | ||
device.pingInterval = setInterval(onPing,1500,device); | ||
debugMessage(`${device.id}: Kill connection watchdog`); | ||
@@ -399,3 +399,3 @@ clearTimeout(device.watchDogConn); | ||
function messageConstructor(messageType, message, device){ | ||
let commands = ['play', 'stop', 'next', 'prev', 'ping']; | ||
let commands = ['play', 'stop', 'next', 'prev', 'ping', 'softwareVersion']; | ||
let extraCommands = ['forward', 'backward', 'volumeup', 'volumedown', 'volume']; | ||
@@ -460,3 +460,3 @@ switch(messageType){ | ||
//node.error(`You can send commands in msg.payload from list as String ${commands + extraCommands}`); | ||
return [{"command": "ping"}]; | ||
return [{"command": "softwareVersion"}]; | ||
} | ||
@@ -601,5 +601,5 @@ case 'voice': | ||
debugMessage('unknown command') | ||
return messageConstructor('command', { 'payload': 'ping' }) | ||
return messageConstructor('command', { 'payload': 'softwareVersion' }) | ||
} else { | ||
return messageConstructor('command', { 'payload': 'ping' }) | ||
return messageConstructor('command', { 'payload': 'softwareVersion' }) | ||
} | ||
@@ -672,7 +672,7 @@ case 'raw': | ||
function onPing(device) { | ||
if (device) {sendMessage(device.id, 'command', {payload: 'ping'});} | ||
if (device) {sendMessage(device.id, 'command', {payload: 'softwareVersion'});} | ||
} | ||
function onPing(device) { | ||
sendMessage(device.id, 'command', {payload: 'ping'}); | ||
sendMessage(device.id, 'command', {payload: 'softwareVersion'}); | ||
} | ||
@@ -679,0 +679,0 @@ function getStatus(id) { |
{ | ||
"name": "node-red-contrib-yandex-station-management", | ||
"version": "0.3.8", | ||
"version": "0.3.9", | ||
"description": "Local management of YandexStation using API on websockets", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,2 +24,4 @@ ## Описание | ||
Третий из вариантов получения токена описан [тут](https://github.com/MarshalX/yandex-music-api/discussions/513#discussioncomment-2729781) | ||
Возможна работа с несколькими устройствами(протестировано) и несколькими учетными записями(протестировано). | ||
@@ -26,0 +28,0 @@ |
822793
521