E-Stop IP
This commit is contained in:
@@ -25,9 +25,11 @@ module.exports = class ShellyEmergencyStop extends SenderInterface {
|
||||
constructor(url, options = {}) {
|
||||
super();
|
||||
this._offUrl = url || null;
|
||||
this._onUrl = url ? url.replace('on=false', 'on=true') : null;
|
||||
// Switch.GetStatus?id=0 — leitet Status-URL aus der Switch.Set-URL ab
|
||||
this._statusUrl = url ? url.replace(/\/rpc\/.*$/, '/rpc/Switch.GetStatus?id=0') : null;
|
||||
// Explizite URL-Felder haben Vorrang vor Ableitungslogik.
|
||||
// Das erlaubt IP-Adressen statt .local-Hostnamen (nötig in Docker-Umgebungen,
|
||||
// wo mDNS nicht verfügbar ist).
|
||||
this._onUrl = options.urlOn || (url ? url.replace('on=false', 'on=true') : null);
|
||||
this._statusUrl = options.urlStatus || (url ? url.replace(/\/rpc\/.*$/, '/rpc/Switch.GetStatus?id=0') : null);
|
||||
this.url = url || null; // für getStatus / InfoServer-Anzeige
|
||||
this.state = 'ready';
|
||||
this.error = null;
|
||||
|
||||
Reference in New Issue
Block a user