mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2026-01-11 10:23:04 +00:00
Restart the add-on when disconnected from the hub or Home Assistant
This commit is contained in:
@@ -124,11 +124,14 @@ export class DemoFimpMqttClient implements IMqttClient {
|
||||
|
||||
once(event: 'connect', handler: () => void): void;
|
||||
once(event: 'error', handler: OnErrorCallback): void;
|
||||
once(event: 'disconnect', handler: () => void): void;
|
||||
once(event: any, handler: any): void {
|
||||
if (event === 'connect') {
|
||||
this.onceConnectHandlers.push(handler);
|
||||
} else if (event === 'error') {
|
||||
this.onceErrorHandlers.push(handler);
|
||||
} else if (event === 'disconnect') {
|
||||
// not possible in demo mode
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,4 +40,5 @@ export interface IMqttClient {
|
||||
|
||||
once(event: 'connect', handler: () => void): void;
|
||||
once(event: 'error', handler: OnErrorCallback): void;
|
||||
once(event: 'disconnect', handler: () => void): void;
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ export class RealMqttClient implements IMqttClient {
|
||||
|
||||
once(event: 'connect', handler: () => void): void;
|
||||
once(event: 'error', handler: OnErrorCallback): void;
|
||||
once(event: 'disconnect', handler: () => void): void;
|
||||
once(event: any, handler: any): void {
|
||||
this.client.once(event, handler);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user