node-red-contrib-yandex-station-management 0.3.8 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,6 +21,8 @@
21
21
 
22
22
  Второй из варинатов его получения описан в [FAQ](#faq)
23
23
 
24
+ Третий из вариантов получения токена описан [тут](https://github.com/MarshalX/yandex-music-api/discussions/513#discussioncomment-2729781)
25
+
24
26
  Возможна работа с несколькими устройствами(протестировано) и несколькими учетными записями(протестировано).
25
27
 
26
28
  Состоит из 4 нод, позволяющих гибко настраивать автоматизации и использовать голосовые уведомления:
@@ -295,7 +295,7 @@ module.exports = function(RED) {
295
295
  device.watchDog = setTimeout(() => {
296
296
  if (typeof(device) != 'undefined' && typeof(device.ws) != 'undefined') {device.ws.close()}
297
297
  }, 10000);
298
- device.pingInterval = setInterval(onPing,300,device);
298
+ device.pingInterval = setInterval(onPing,1500,device);
299
299
  debugMessage(`${device.id}: Kill connection watchdog`);
300
300
  clearTimeout(device.watchDogConn);
301
301
  clearTimeout(device.timer);
@@ -395,7 +395,7 @@ module.exports = function(RED) {
395
395
  };
396
396
 
397
397
  function messageConstructor(messageType, message, device){
398
- let commands = ['play', 'stop', 'next', 'prev', 'ping'];
398
+ let commands = ['play', 'stop', 'next', 'prev', 'ping', 'softwareVersion'];
399
399
  let extraCommands = ['forward', 'backward', 'volumeup', 'volumedown', 'volume'];
400
400
  switch(messageType){
401
401
  case 'command':
@@ -455,7 +455,7 @@ module.exports = function(RED) {
455
455
  } else {
456
456
  debugMessage(`Bad command ${message.payload}`)
457
457
  //node.error(`You can send commands in msg.payload from list as String ${commands + extraCommands}`);
458
- return [{"command": "ping"}];
458
+ return [{"command": "softwareVersion"}];
459
459
  }
460
460
  case 'voice':
461
461
  debugMessage(`Message Voice command: ${message}`);
@@ -595,9 +595,9 @@ module.exports = function(RED) {
595
595
  }
596
596
 
597
597
  debugMessage('unknown command')
598
- return messageConstructor('command', { 'payload': 'ping' })
598
+ return messageConstructor('command', { 'payload': 'softwareVersion' })
599
599
  } else {
600
- return messageConstructor('command', { 'payload': 'ping' })
600
+ return messageConstructor('command', { 'payload': 'softwareVersion' })
601
601
  }
602
602
  case 'raw':
603
603
  if (Array.isArray(message.payload)) { return message.payload }
@@ -665,11 +665,11 @@ module.exports = function(RED) {
665
665
  }
666
666
  }
667
667
  function onPing(device) {
668
- if (device) {sendMessage(device.id, 'command', {payload: 'ping'});}
668
+ if (device) {sendMessage(device.id, 'command', {payload: 'softwareVersion'});}
669
669
  }
670
670
 
671
671
  function onPing(device) {
672
- sendMessage(device.id, 'command', {payload: 'ping'});
672
+ sendMessage(device.id, 'command', {payload: 'softwareVersion'});
673
673
  }
674
674
  function getStatus(id) {
675
675
  let device = searchDeviceByID(id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-yandex-station-management",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "Local management of YandexStation using API on websockets",
5
5
  "main": "index.js",
6
6
  "scripts": {