Use ENV var SUPERVISOR_TOKEN as fallback for password
This commit is contained in:
@@ -108,6 +108,7 @@ Please check it https://www.smarthomejetzt.de/mit-iobroker-auf-eine-home-assista
|
|||||||
## Changelog
|
## Changelog
|
||||||
### **WORK IN PROGRESS**
|
### **WORK IN PROGRESS**
|
||||||
* (@klein0r) Use /core/ instead of /api/ when connecting to supervisor directly (e.g. in ha app)
|
* (@klein0r) Use /core/ instead of /api/ when connecting to supervisor directly (e.g. in ha app)
|
||||||
|
* (@klein0r) Use ENV var SUPERVISOR_TOKEN as fallback for password
|
||||||
|
|
||||||
### 2.0.3 (2026-04-02)
|
### 2.0.3 (2026-04-02)
|
||||||
* (@GermanBluefox) Adapter was updated and migrated to TypeScript
|
* (@GermanBluefox) Adapter was updated and migrated to TypeScript
|
||||||
|
|||||||
+3
-2
@@ -108,11 +108,12 @@ export default class HASS extends EventEmitter {
|
|||||||
this.emit('state_changed', response.event.data.new_state);
|
this.emit('state_changed', response.event.data.new_state);
|
||||||
}
|
}
|
||||||
} else if (response.type === 'auth_required') {
|
} else if (response.type === 'auth_required') {
|
||||||
if (!this.options.password) {
|
const password = this.options.password || process.env.SUPERVISOR_TOKEN;
|
||||||
|
if (!password) {
|
||||||
this.emit('error', 'Password required. Connection closed');
|
this.emit('error', 'Password required. Connection closed');
|
||||||
socket.terminate();
|
socket.terminate();
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => this.sendAuth(socket, this.options.password!), 50);
|
setTimeout(() => this.sendAuth(socket, password), 50);
|
||||||
}
|
}
|
||||||
} else if (response.type === 'auth_ok') {
|
} else if (response.type === 'auth_ok') {
|
||||||
setImmediate(() =>
|
setImmediate(() =>
|
||||||
|
|||||||
Reference in New Issue
Block a user