iobroker.sayit 4.0.2 → 4.0.4

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
@@ -267,9 +267,10 @@ The following values for engines are possible:
267
267
  ### **WORK IN PROGRESS**
268
268
  -->
269
269
  ## Changelog
270
- ### 4.0.2 (2024-07-11)
270
+ ### 4.0.4 (2024-07-11)
271
271
  * (bluefox) Packages updated
272
272
  * (bluefox) Corrected playing in vis
273
+ * (bluefox) Corrected blockly
273
274
 
274
275
  ### 4.0.1 (2024-05-25)
275
276
  * (bluefox) Packages updated
package/io-package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "sayit",
4
- "version": "4.0.2",
4
+ "version": "4.0.4",
5
5
  "news": {
6
- "4.0.2": {
7
- "en": "Packages updated\nCorrected playing in vis",
8
- "de": "Pakete aktualisiert\nKorrigiertes Spielen in Vis",
9
- "ru": "Обновленные пакеты\nИсправленная игра в vis",
10
- "pt": "Pacotes atualizados\nJogo correto em vis",
11
- "nl": "Pakketten bijgewerkt\nGecorrigeerd spelen in vis",
12
- "fr": "Mise à jour des paquets\nCorrigé jouer dans vis",
13
- "it": "Pacchetti aggiornati\nCorretto giocare in vis",
14
- "es": "Paquetes actualizados\nCorregido jugando en vis",
15
- "pl": "Aktualizacja pakietów\nPoprawione gry w vis",
16
- "uk": "Пакети оновлені\nПравильна гра в віках",
17
- "zh-cn": "更新软件包\n已校正播放相对"
6
+ "4.0.4": {
7
+ "en": "Packages updated\nCorrected playing in vis\nCorrected blockly",
8
+ "de": "Pakete aktualisiert\nKorrigiertes Spielen in Vis\nBlockiert korrigiert",
9
+ "ru": "Обновленные пакеты\nИсправленная игра в vis\nИсправлено блокно",
10
+ "pt": "Pacotes atualizados\nJogo correto em vis\nCorrigido em bloco",
11
+ "nl": "Pakketten bijgewerkt\nGecorrigeerd spelen in vis\nBloksgewijs gecorrigeerd",
12
+ "fr": "Mise à jour des paquets\nCorrigé jouer dans vis\nCorrigé en bloc",
13
+ "it": "Pacchetti aggiornati\nCorretto giocare in vis\nCorretto in blocco",
14
+ "es": "Paquetes actualizados\nCorregido jugando en vis\nCorregido bloqueado",
15
+ "pl": "Aktualizacja pakietów\nPoprawione gry w vis\nPoprawione blokowane",
16
+ "uk": "Пакети оновлені\nПравильна гра в віках\nВиправлено блоклі",
17
+ "zh-cn": "更新软件包\n已校正播放相对\n块状修正"
18
18
  },
19
19
  "4.0.1": {
20
20
  "en": "Packages updated\nUsing the pre-calculated duration of the mp3 to wait long enough even for longer announcements",
package/main.js CHANGED
@@ -102,7 +102,25 @@ function startAdapter(options) {
102
102
 
103
103
  function processMessage(obj) {
104
104
  if (obj) {
105
- if (obj.command === 'stopInstance') {
105
+ if (obj.command === 'say') {
106
+ const text = obj.message?.text;
107
+ const language = obj.message?.language;
108
+ const volume = obj.message?.volume;
109
+
110
+ if (text) {
111
+ if (obj.callback) {
112
+ const opts = {...obj.message};
113
+ opts.callback = error => {
114
+ adapter.sendTo(obj.from, obj.command, {error, result: error ? undefined : 'Ok'}, obj.callback);
115
+ };
116
+ addToQueue(text, language, volume, null, opts);
117
+ } else {
118
+ addToQueue(text, language, volume);
119
+ }
120
+ } else {
121
+ adapter.sendTo(obj.from, obj.command, {error : 'No text'}, obj.callback);
122
+ }
123
+ } else if (obj.command === 'stopInstance') {
106
124
  stop(false, () =>
107
125
  obj.callback && adapter.sendTo(obj.from, obj.command, null, obj.callback));
108
126
  } else if (obj.callback && obj.command === 'browseGoogleHome') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.sayit",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "description": "Text to speech interface for ioBroker.",
5
5
  "author": {
6
6
  "name": "bluefox",