iobroker.javascript 9.2.1 → 9.2.2
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 +6 -5
- package/admin/assets/{AiChatPanel-Cc1KscBJ.js → AiChatPanel-Bbux7LP7.js} +15 -15
- package/admin/assets/{ScriptEditor-6qrtvwPL.js → ScriptEditor-DKljeYQN.js} +1 -1
- package/admin/assets/{ScriptEditorVanillaMonaco-bJua4sm1.js → ScriptEditorVanillaMonaco-CaFyKuJ2.js} +2 -2
- package/admin/assets/{index-CYbVtccs.js → index-DSvAO584.js} +4 -4
- package/admin/assets/{index-DsW7vBcg.js → index-DgE6XhUM.js} +1 -1
- package/admin/assets/{index-BZxCaQhO.js → index-_BUuZlI0.js} +1 -1
- package/admin/google-blockly/own/blocks_system.js +34 -0
- package/admin/google-blockly/own/blocks_words.js +4 -0
- package/admin/tab.html +1 -1
- package/docs/de/README.md +2 -0
- package/docs/de/blockly.md +669 -8
- package/docs/en/blockly.md +33 -0
- package/io-package.json +14 -1
- package/package.json +1 -1
package/docs/en/blockly.md
CHANGED
|
@@ -760,6 +760,39 @@ Typical usage:
|
|
|
760
760
|
</xml>
|
|
761
761
|
```
|
|
762
762
|
|
|
763
|
+
### State exists
|
|
764
|
+
|
|
765
|
+
This block returns a boolean (`true` / `false`) indicating whether the given state currently has a value record in the state DB. The OID is supplied via a value input, so it can come from the OID selector block (`Object ID`), a string variable, or any other block that produces a state ID.
|
|
766
|
+
|
|
767
|
+
**Why is this useful?** ioBroker stores objects (metadata) and states (values) separately. An adapter can create a state's *object* — so the object ID appears in the OID picker — without ever writing a *value*. In that case, calling `getState(...)` will log a warning:
|
|
768
|
+
|
|
769
|
+
```
|
|
770
|
+
warn getState "zigbee.0.187a3efffee9e4e8.load_power" not found (3)
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
Even a check like `value of Object ID … != null` will trigger that warning, because the warning happens *during* the `getState` call itself — before the comparison is evaluated.
|
|
774
|
+
|
|
775
|
+
The **State exists** block uses `existsStateAsync(...)` under the hood, which checks the cache silently and never logs a warning when the state is missing. This is the correct way to guard a `getState` call for adapters that pre-create data points lazily (e.g. zigbee, Tuya).
|
|
776
|
+
|
|
777
|
+
Typical usage — guard a value read against missing state records:
|
|
778
|
+
|
|
779
|
+
```
|
|
780
|
+
if [State exists [Object ID "zigbee.0.…load_power"]]
|
|
781
|
+
set [power] to [Value of Object ID "zigbee.0.…load_power"]
|
|
782
|
+
log [power]
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
The generated JavaScript is:
|
|
786
|
+
|
|
787
|
+
```javascript
|
|
788
|
+
if ((await existsStateAsync('zigbee.0.187a3efffee9e4e8.load_power'))) {
|
|
789
|
+
let power = getState('zigbee.0.187a3efffee9e4e8.load_power').val;
|
|
790
|
+
console.log(power);
|
|
791
|
+
}
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
**Note:** With the adapter setting *"Do not subscribe to all states on start"* enabled, `existsState` cannot be evaluated synchronously. The block emits the async form (`await existsStateAsync(...)`), so it works correctly in both modes.
|
|
795
|
+
|
|
763
796
|
## Actions Blocks
|
|
764
797
|
|
|
765
798
|
### Exec - execute
|
package/io-package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "javascript",
|
|
4
|
-
"version": "9.2.
|
|
4
|
+
"version": "9.2.2",
|
|
5
5
|
"blockedVersions": [
|
|
6
6
|
"8.0.0",
|
|
7
7
|
"8.0.1"
|
|
@@ -40,6 +40,19 @@
|
|
|
40
40
|
"Matthias Kleine <info@haus-automatisierung.com>"
|
|
41
41
|
],
|
|
42
42
|
"news": {
|
|
43
|
+
"9.2.2": {
|
|
44
|
+
"en": "Fix: AI chat mode tooltip no longer covers the dropdown options (issue #2201) — moved tooltip to the left of the selector\nClarified the AI chat mode descriptions in the tooltip: Agent is for larger models with tool support and handles both analysis and script creation, Code is for smaller models without tool support (uses two-step plan-then-code) — translations updated in all 11 languages\nAdded the \"is state exists\" block to blockly",
|
|
45
|
+
"de": "Fix: AI-Chat-Modus-Tooltip nicht mehr deckt die Dropdown-Optionen (Ausgabe #2201) - verschoben Tooltip auf die linke Seite des Selektors\nKI-Chat-Modus Beschreibungen im Tooltip: Agent ist für größere Modelle mit Werkzeugunterstützung und behandelt sowohl Analyse als auch Skript-Erstellung, Code ist für kleinere Modelle ohne Werkzeugunterstützung (verwendet zweistufigen Plan-then-Code) — Übersetzungen aktualisiert in allen 11 Sprachen\nDer \"is state exist\" Block wurde blockweise hinzugefügt",
|
|
46
|
+
"ru": "Исправление: инструментарий режима чата AI больше не покрывает выпадающие опции (выпуск #2201) — перемещаемый инструментарий слева от селектора\nУточнено описание режима чата ИИ в подсказке: Агент предназначен для более крупных моделей с поддержкой инструментов и обрабатывает как анализ, так и создание сценариев, Код предназначен для более мелких моделей без поддержки инструментов (использует двухэтапный план-тогда-код) — переводы обновлены на всех 11 языках\nДобавлен блок «существует государство» для блокировки",
|
|
47
|
+
"pt": "Corrigir: A dica do modo de bate-papo de IA não cobre mais as opções suspensas (questão # 2201) — moveu a dica para a esquerda do seletor\nClarified the AI chat mode descriptions in the tooltip: Agent is for major models with tool support and hands both analysis and script creation, Code is for minor models without toool support (uses two-step plan-then-code) — translations updated in all 11 languages\nAdicionado o bloco \"is state existe\" para bloquear",
|
|
48
|
+
"nl": "Fix: AI chat mode tooltip heeft geen betrekking meer op de dropdown opties (issue #2201)\nVerduidelijkt de AI chat mode beschrijvingen in de tooltip: Agent is voor grotere modellen met hulpmiddel ondersteuning en behandelt zowel analyse als script creatie, Code is voor kleinere modellen zonder hulpmiddel ondersteuning (gebruikt twee-stap plan-dan-code) Vertalingen bijgewerkt in alle 11 talen\nToegevoegd de \"is status bestaat\" blok te blokkeren",
|
|
49
|
+
"fr": "Correction : l'outil en mode chat AI ne couvre plus les options déroulantes (numéro #2201) — l'outil déplacé à gauche du sélecteur\nClarifié les descriptions des modes de chat AI dans l'infobulle : Agent est pour les modèles plus grands avec support d'outil et gère à la fois l'analyse et la création de script, Code est pour les modèles plus petits sans support d'outil (utilise le plan en deux étapes - puis-code) — traductions mises à jour dans les 11 langues\nAjout du bloc « is state exists » pour bloquer",
|
|
50
|
+
"it": "Fix: AI chat mode tooltip non copre più le opzioni di discesa (problema #2201) — spostato tooltip a sinistra del selettore\nClarified le descrizioni della modalità di chat AI nel tooltip: L'agente è per i modelli più grandi con supporto degli strumenti e gestisce sia l'analisi che la creazione di script, il codice è per i modelli più piccoli senza supporto degli strumenti (utilizza il codice a due passi) — le traduzioni aggiornate in tutte le 11 lingue\nAggiunto il blocco \"è stato esiste\" per bloccare",
|
|
51
|
+
"es": "Fijación: El uso de herramientas de modo de chat AI ya no cubre las opciones desplegables (sue #2201) — mover la punta de la herramienta a la izquierda del selector\nClarified the AI chat mode descriptions in the tooltip: Agent is for larger models with tool support and handles both analysis and script creation, Code is for smaller models without tool support (uses two-step plan-then-code) — translations updated in all 11 languages\nAñadido el bloque \"es estado existe\" para bloquear",
|
|
52
|
+
"pl": "Fix: AI chat mode tooltip już nie obejmuje opcji Dropdown (issue # 2201) - przesunięty podpowiedź po lewej stronie selektora\nWyjaśnienie opisów trybu rozmowy AI w podpowiedzi: Agent jest dla większych modeli z obsługą narzędzi i obsługuje zarówno analizy i tworzenia skryptów, Kod jest dla mniejszych modeli bez obsługi narzędzia (używa dwustopniowej plan- theen- code) - tłumaczenia zaktualizowane we wszystkich 11 językach\nDodano blokadę \"is state istnieje\"",
|
|
53
|
+
"uk": "Виправлення: Інструментарій режимів AI не більше охоплює параметри випадання (видання #2201) — пересувний інструмент для ліворуч від selector\nНаведено описи режиму AI чату в інструменті: Агент призначений для збільшення моделей з підтримкою інструментів і ручками як аналізу, так і для створення сценаріїв, Код є для менших моделей без підтримки інструменту ( використовує двокроковий план-фін-код) — переклади, оновлено у всіх 11 мовах\nДодано блок-блок \"is State існує\"",
|
|
54
|
+
"zh-cn": "固定:AI聊天模式工具提示不再覆盖下拉选项(问题#2201)——移动工具提示到选择器左侧\n整理工具提示中的 AI 聊天模式描述 : Agent 用于具有工具支持的较大模型,并同时处理分析和脚本创建, Code 用于没有工具支持的较小模型(使用双步计划-当时的代码)——所有11种语言的翻译更新\n添加“ 状态存在” 块以阻断"
|
|
55
|
+
},
|
|
43
56
|
"9.2.1": {
|
|
44
57
|
"en": "See previous changelog entries",
|
|
45
58
|
"de": "Siehe frühere Changelog-Einträge",
|