node-red-contrib-sonospollytts
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -6,2 +6,6 @@ ![Sample Node](img/logo.png) | ||
<p> | ||
<b>Version 2.0.4</b> December 2020<br/> | ||
- NEW: multiple sonospollytts node coordinator. Now, if you use more than one sonospollytts node, the server will coordinate the play between all, without conflicts.<br/> | ||
</p> | ||
<p> | ||
<b>Version 2.0.3</b> December 2020<br/> | ||
@@ -8,0 +12,0 @@ - FIX: sonospollytts can remain stuck on "Busy handling queue.." if if fails grouping more than one speaker. Fixed.<br/> |
{ | ||
"name": "node-red-contrib-sonospollytts", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Node-Red TTS with Sonos and Amazon Polly or with your own local mp3 announcement files. Transforms the text in speech and hear it using Sonos player. Can work OFFLINE as well! This node is specific for security alarm announcement, doorbell, weather annoucement etc.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,4 +26,4 @@ module.exports = function (RED) { | ||
node.polly = new AWS.Polly(params); | ||
node.userDir = path.join(RED.settings.userDir, "sonospollyttsstorage"); // 09/03/2020 Storage of sonospollytts (otherwise, at each upgrade to a newer version, the node path is wiped out and recreated, loosing all custom files) | ||
node.whoIsUsingTheServer = ""; // Client node.id using the server, because only a sonospollytts node can use the serve at once. | ||
@@ -30,0 +30,0 @@ // 03/06/2019 you can select the temp dir |
@@ -191,2 +191,3 @@ const { clear } = require('console'); | ||
node.bBusyPlayingQueue = false; | ||
if (node.server.whoIsUsingTheServer === node.id) node.server.whoIsUsingTheServer = ""; | ||
} | ||
@@ -292,2 +293,3 @@ | ||
node.bBusyPlayingQueue = true; | ||
node.server.whoIsUsingTheServer = node.id; // Signal to other sonospollytts node, that i'm using the Sonos device | ||
try { | ||
@@ -482,2 +484,3 @@ | ||
node.bBusyPlayingQueue = false | ||
node.server.whoIsUsingTheServer = ""; // Signal to other sonospollytts node, that i'm not using the Sonos device anymore | ||
}, 1000) | ||
@@ -554,6 +557,11 @@ // } | ||
node.oTimerCacheFlowMSG = setTimeout(() => { | ||
if (!node.bBusyPlayingQueue && node.tempMSGStorage.length > 0) { | ||
HandleQueue(); | ||
// Checks if someone else is using the server node | ||
if (node.server.whoIsUsingTheServer === "" || node.server.whoIsUsingTheServer === node.id) { | ||
if (!node.bBusyPlayingQueue && node.tempMSGStorage.length > 0) { | ||
HandleQueue(); | ||
} else { | ||
if (node.tempMSGStorage.length > 0) node.setNodeStatus({ fill: 'grey', shape: 'ring', text: "Busy with " + node.tempMSGStorage.length + " items in queue. Retry..." }); | ||
} | ||
} else { | ||
if (node.tempMSGStorage.length > 0) node.setNodeStatus({ fill: 'grey', shape: 'ring', text: "Busy with " + node.tempMSGStorage.length + " items in queue. Retry..." }); | ||
node.setNodeStatus({ fill: 'yellow', shape: 'ring', text: "Sonos is occupied by " + node.server.whoIsUsingTheServer + " Retry..." }); | ||
} | ||
@@ -620,5 +628,2 @@ node.waitForQueue(); | ||
}); | ||
//node.sPollyState == "criticalwriting"; | ||
// RED.log.error('SonosPollyTTS: notifyError - unable to write TTS file. Check user permissions'); | ||
//RED.log.error('SonosPollyTTS: notifyError - msg: ' + msg + ' error: ' + errorMessage); | ||
// Set error in message | ||
@@ -625,0 +630,0 @@ msg.error = errorMessage; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
846105
925