Add conditional check for Tuya web socket service

This commit is contained in:
faris Aljohari
2024-06-02 19:30:51 +03:00
parent 948d133e4f
commit 8cf8a2da90
2 changed files with 8 additions and 4 deletions

View File

@ -22,11 +22,13 @@ export class TuyaWebSocketService {
maxRetryTimes: 100,
});
// Set up event handlers
this.setupEventHandlers();
if (this.configService.get<string>('tuya-config.TRUN_ON_TUYA_SOCKET')) {
// Set up event handlers
this.setupEventHandlers();
// Start receiving messages
this.client.start();
// Start receiving messages
this.client.start();
}
}
private setupEventHandlers() {