Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Executes Javascript, Typescript Scripts.
### **WORK IN PROGRESS**
-->
### WORK IN PROGRESS
* (Eistee82) Fix: prevent duplicate 'Stopping script' log when script is not running
* (Eistee82) Fix: only restart scripts on the instance that owns them
* (Eistee82) Added OID display mode toggle for Blockly editor: 4 display modes (Name, Name path, State ID, Full ID) with toolbar dropdown, context menu, optional object icons, and translations in 11 languages
* Per-provider test buttons in adapter config (OpenAI, Anthropic, Gemini, DeepSeek, Custom API)
* Optional API key field for custom base URL providers (e.g. Ollama without auth)
Expand Down
9 changes: 6 additions & 3 deletions build/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,11 @@ class JavaScript extends Adapter {
// Start script
await this.loadScriptById(id);
}
} else {
// if (obj.common.source !== formerObj.common.source) {
// Source changed => restart the script
} else if (
obj.common.engine === `system.adapter.${this.namespace}` ||
formerObj.common.engine === `system.adapter.${this.namespace}`
) {
// Source changed => restart the script (only on the relevant instance)
this.stopCounters[id] = this.stopCounters[id] ? this.stopCounters[id] + 1 : 1;
void this.stopScript(id).then(() => {
// only start again after stop when "last" object change to prevent problems on
Expand Down Expand Up @@ -2601,6 +2603,10 @@ class JavaScript extends Adapter {
}

async stopScript(name: string): Promise<boolean> {
if (!this.scripts[name]) {
return false;
}

this.log.info(`${name}: Stopping script`);

await this.setState(`scriptEnabled.${name.substring(SCRIPT_CODE_MARKER.length)}`, false, true);
Expand Down
Loading