iobroker.sayit 3.0.4 → 3.0.5
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 +2 -1
- package/admin/blockly.js +25 -35
- package/io-package.json +13 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -267,12 +267,13 @@ Following values for engines are possible:
|
|
|
267
267
|
### **WORK IN PROGRESS**
|
|
268
268
|
-->
|
|
269
269
|
## Changelog
|
|
270
|
-
### 3.0.
|
|
270
|
+
### 3.0.5 (2023-04-17)
|
|
271
271
|
* (bluefox) Corrected error with System player
|
|
272
272
|
* (bluefox) Do not allow for chromecast to cache files.
|
|
273
273
|
* (bluefox) Allowed to add cloud App-Key without running cloud adapter
|
|
274
274
|
* (bluefox) Added austrian language
|
|
275
275
|
* (bluefox) Added norwegian language
|
|
276
|
+
* (klein0r) Used sendTo instead of setState in blockly
|
|
276
277
|
|
|
277
278
|
### 3.0.0 (2023-04-03)
|
|
278
279
|
* (bluefox) Restored cloud engines. Warning: update cloud adapter to at least 4.4.0
|
package/admin/blockly.js
CHANGED
|
@@ -32,8 +32,7 @@ Blockly.Words['sayit_log_debug'] = {'en': 'debug', 'de
|
|
|
32
32
|
Blockly.Words['sayit_log_warn'] = {'en': 'warning', 'de': 'warning', 'ru': 'warning'};
|
|
33
33
|
Blockly.Words['sayit_log_error'] = {'en': 'error', 'de': 'error', 'ru': 'ошибка'};
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
// this is copy of engines.js
|
|
35
|
+
// this is copy of lib/engines.js
|
|
37
36
|
const sayitEngines = {
|
|
38
37
|
"en": {name: "Google - English", engine: "google", params: []},
|
|
39
38
|
"de": {name: "Google - Deutsch", engine: "google", params: []},
|
|
@@ -234,36 +233,37 @@ Blockly.Sendto.blocks['sayit'] =
|
|
|
234
233
|
|
|
235
234
|
Blockly.Blocks['sayit'] = {
|
|
236
235
|
init: function() {
|
|
237
|
-
|
|
236
|
+
const options = [];
|
|
238
237
|
if (typeof main !== 'undefined' && main.instances) {
|
|
239
|
-
for (
|
|
240
|
-
|
|
238
|
+
for (let i = 0; i < main.instances.length; i++) {
|
|
239
|
+
const m = main.instances[i].match(/^system.adapter.sayit.(\d+)$/);
|
|
241
240
|
if (m) {
|
|
242
|
-
|
|
241
|
+
const n = parseInt(m[1], 10);
|
|
243
242
|
options.push(['sayit.' + n, '.' + n]);
|
|
244
243
|
}
|
|
245
244
|
}
|
|
246
245
|
}
|
|
247
246
|
|
|
248
|
-
if (options.length
|
|
249
|
-
for (
|
|
250
|
-
options.push(['sayit.' +
|
|
247
|
+
if (!options.length) {
|
|
248
|
+
for (let k = 0; k <= 4; k++) {
|
|
249
|
+
options.push(['sayit.' + k, '.' + k]);
|
|
251
250
|
}
|
|
252
251
|
}
|
|
252
|
+
options.unshift([Blockly.Translate('sayit_anyInstance'), '']);
|
|
253
253
|
|
|
254
254
|
this.appendDummyInput('INSTANCE')
|
|
255
255
|
.appendField(Blockly.Translate('sayit'))
|
|
256
256
|
.appendField(new Blockly.FieldDropdown(options), 'INSTANCE');
|
|
257
257
|
|
|
258
|
-
|
|
259
|
-
for (
|
|
258
|
+
const languages = [[Blockly.Translate('sayit_configured'), '']];
|
|
259
|
+
for (const l in sayitEngines) {
|
|
260
260
|
if (sayitEngines.hasOwnProperty(l)) languages.push([sayitEngines[l].name, l]);
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
this.appendDummyInput('LANGUAGE')
|
|
264
264
|
.appendField(new Blockly.FieldDropdown(languages), 'LANGUAGE');
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
const input = this.appendValueInput('VOLUME')
|
|
267
267
|
.setCheck('Number')
|
|
268
268
|
.appendField(Blockly.Translate('sayit_volume'));
|
|
269
269
|
if (input.connection) input.connection._optional = true;
|
|
@@ -292,30 +292,20 @@ Blockly.Blocks['sayit'] = {
|
|
|
292
292
|
};
|
|
293
293
|
|
|
294
294
|
Blockly.JavaScript['sayit'] = function(block) {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
var logLevel = block.getFieldValue('LOG');
|
|
295
|
+
const language = block.getFieldValue('LANGUAGE');
|
|
296
|
+
const text = Blockly.JavaScript.valueToCode(block, 'MESSAGE', Blockly.JavaScript.ORDER_ATOMIC);
|
|
297
|
+
const volume = Blockly.JavaScript.valueToCode(block, 'VOLUME', Blockly.JavaScript.ORDER_ATOMIC);
|
|
298
|
+
const logLevel = block.getFieldValue('LOG');
|
|
300
299
|
|
|
301
|
-
|
|
300
|
+
let logText = '';
|
|
302
301
|
if (logLevel) {
|
|
303
|
-
logText = '
|
|
304
|
-
} else {
|
|
305
|
-
logText = '';
|
|
302
|
+
logText = '\nconsole.' + logLevel + '("Executed sayit' + block.getFieldValue('INSTANCE') + ': ' + (volume ? '[Volume - ' + volume + ']' : '') + ': " + ' + text + ');\n';
|
|
306
303
|
}
|
|
307
304
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
return output;
|
|
318
|
-
} else {
|
|
319
|
-
return 'setState("sayit' + dropdown_instance + '.tts.text", "' + (dropdown_language ? dropdown_language + ';' : '') + (value_volume !== null && value_volume !== '' ? '" + ' + value_volume + ' + ";' : '') + '" + ' + value_message + ');\n' + logText;
|
|
320
|
-
}
|
|
321
|
-
};
|
|
305
|
+
const objText = [];
|
|
306
|
+
language && objText.push('language: "' + language + '"');
|
|
307
|
+
text && objText.push('text: ' + text);
|
|
308
|
+
volume && objText.push('volume: ' + volume);
|
|
309
|
+
|
|
310
|
+
return 'sendTo("sayit' + block.getFieldValue('INSTANCE') + '", "say", { ' + objText.join(', ') + ' });' + logText;
|
|
311
|
+
};
|
package/io-package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "sayit",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.5",
|
|
5
5
|
"news": {
|
|
6
|
-
"3.0.
|
|
7
|
-
"en": "Corrected error with System player\nDo not allow for chromecast to cache files.\nAllowed to add cloud App-Key without running cloud adapter\nAdded austrian language\nAdded norwegian language",
|
|
8
|
-
"de": "Fehler behoben mit Systemplayer\nErlauben Sie nicht, dass Chromecast Dateien zwischenspeichern.\nCloud App-Key ohne Cloud-Adapter hinzufügen\nSprache hinzufügen\nNorwegische Sprache",
|
|
9
|
-
"ru": "Исправлена ошибка с Системным игроком\nНе допускайте хромката к файлам кэша.\nДопускается добавление облачного App-Key без запуска облачного адаптера\nДобавлен австрийский язык\nДобавлен норвежский
|
|
10
|
-
"pt": "Erro correto com o jogador do sistema\nNão permita que o chromecast em cache arquivos.\nPermite adicionar Cloud App-Key sem executar o adaptador de nuvem\nAdicionado idioma austriano\nLíngua norwegian adicionada",
|
|
11
|
-
"nl": "Correctie fout met System speler\nSta niet toe dat chromecast naar cache bestanden gaat.\nWolken toevoegen App-Key zonder wolken adapter\nAustrian taal\n_",
|
|
12
|
-
"fr": "Erreur corrigée avec le lecteur système\nNe pas permettre de chromecast aux fichiers de cache.\nPermet d'ajouter nuage App-Key sans adaptateur cloud\nAjout de la langue austrienne\nAjout de la langue norvégienne",
|
|
13
|
-
"it": "Errore corretto con il giocatore di sistema\nNon consentire per Chromecast a file di cache.\nConsentito di aggiungere cloud App-Key senza l'adattatore cloud in esecuzione\nAggiunto lingua austriana\nAggiunto lingua norvegese",
|
|
14
|
-
"es": "Error corregido con el reproductor de sistema\nNo permita el cromocast a los archivos de caché.\nPermitido añadir nube App-Key sin adaptador de nube\nIdioma austriano añadido\nIdioma noruego",
|
|
15
|
-
"pl": "Poprawiony błąd z graczem Systema\nNie pozwala na chromecast do plików podręcznych.\nAllowe dodają do chmury App-Key bez uruchamiania adaptacji chmur\nJęzyk austrowany\nJęzyk norweski",
|
|
16
|
-
"uk": "Виправлена помилка з плеєром системи\nНе дозволяйте хромувати файлам кешу.\nДодайте хмарний App-Key без запуску хмарного адаптера\nДодана аустрія мова\nДодана нівезька
|
|
17
|
-
"zh-cn": "与系统参与者的更正错误\n不是允许用彩色图书写。.\n允许增加云雾剂,不带云雾剂。\n增加使用费语\n增
|
|
6
|
+
"3.0.5": {
|
|
7
|
+
"en": "Corrected error with System player\nDo not allow for chromecast to cache files.\nAllowed to add cloud App-Key without running cloud adapter\nAdded austrian language\nAdded norwegian language\nUsed sendTo instead of setState in blockly",
|
|
8
|
+
"de": "Fehler behoben mit Systemplayer\nErlauben Sie nicht, dass Chromecast Dateien zwischenspeichern.\nCloud App-Key ohne Cloud-Adapter hinzufügen\nSprache hinzufügen\nNorwegische Sprache\nAngemeldet An statt setState blockweise",
|
|
9
|
+
"ru": "Исправлена ошибка с Системным игроком\nНе допускайте хромката к файлам кэша.\nДопускается добавление облачного App-Key без запуска облачного адаптера\nДобавлен австрийский язык\nДобавлен норвежский язык\nИспользованный отправить Вместо setState в блокно",
|
|
10
|
+
"pt": "Erro correto com o jogador do sistema\nNão permita que o chromecast em cache arquivos.\nPermite adicionar Cloud App-Key sem executar o adaptador de nuvem\nAdicionado idioma austriano\nLíngua norwegian adicionada\nEnviado Para em vez de setState em blockly",
|
|
11
|
+
"nl": "Correctie fout met System speler\nSta niet toe dat chromecast naar cache bestanden gaat.\nWolken toevoegen App-Key zonder wolken adapter\nAustrian taal\n_\nVerzonden In plaats van te settelen in blok",
|
|
12
|
+
"fr": "Erreur corrigée avec le lecteur système\nNe pas permettre de chromecast aux fichiers de cache.\nPermet d'ajouter nuage App-Key sans adaptateur cloud\nAjout de la langue austrienne\nAjout de la langue norvégienne\nExpéditeur utilisé Au lieu de définir l'Etat en bloc",
|
|
13
|
+
"it": "Errore corretto con il giocatore di sistema\nNon consentire per Chromecast a file di cache.\nConsentito di aggiungere cloud App-Key senza l'adattatore cloud in esecuzione\nAggiunto lingua austriana\nAggiunto lingua norvegese\nInviato usato Al posto di setState in blocco",
|
|
14
|
+
"es": "Error corregido con el reproductor de sistema\nNo permita el cromocast a los archivos de caché.\nPermitido añadir nube App-Key sin adaptador de nube\nIdioma austriano añadido\nIdioma noruego\nEnvío usado En lugar de establecer el Estado en bloque",
|
|
15
|
+
"pl": "Poprawiony błąd z graczem Systema\nNie pozwala na chromecast do plików podręcznych.\nAllowe dodają do chmury App-Key bez uruchamiania adaptacji chmur\nJęzyk austrowany\nJęzyk norweski\nPrzesłać Zamiast tego, zamiast sprostać",
|
|
16
|
+
"uk": "Виправлена помилка з плеєром системи\nНе дозволяйте хромувати файлам кешу.\nДодайте хмарний App-Key без запуску хмарного адаптера\nДодана аустрія мова\nДодана нівезька мова\nВикористовується відправка замість setState в блоклі",
|
|
17
|
+
"zh-cn": "与系统参与者的更正错误\n不是允许用彩色图书写。.\n允许增加云雾剂,不带云雾剂。\n增加使用费语\n增 语\n使用寄送 而不是阻挠国家"
|
|
18
18
|
},
|
|
19
19
|
"3.0.0": {
|
|
20
20
|
"en": "Restored cloud engines. Warning: update cloud adapter to at least 4.4.0\nBreaking changes: Minimal node.js version is 14",
|