refactor: Enhance environment configuration and loading mechanism
- Implement flexible environment variable loading strategy - Add support for environment-specific and local override configuration files - Create new `loadEnv.ts` module for dynamic environment configuration - Update configuration loading in multiple config files - Remove deprecated `.env.development.template` - Add setup script for environment validation - Improve WebSocket error handling and client configuration
This commit is contained in:
@@ -74,8 +74,11 @@ export class HassWebSocketClient extends EventEmitter {
|
||||
};
|
||||
|
||||
this.ws.onerror = (event: WebSocket.ErrorEvent) => {
|
||||
this.emit('error', event);
|
||||
reject(event);
|
||||
const error = event.error || new Error(event.message || 'WebSocket error');
|
||||
this.emit('error', error);
|
||||
if (!this.authenticated) {
|
||||
reject(error);
|
||||
}
|
||||
};
|
||||
|
||||
this.ws.onmessage = (event: WebSocket.MessageEvent) => {
|
||||
|
||||
Reference in New Issue
Block a user