Skip to content

Commit

Permalink
feat: Log EZSP adapter deprecated (#1039)
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Apr 30, 2024
1 parent e90595a commit d55a267
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/adapter/ezsp/adapter/ezspAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class EZSPAdapter extends Adapter {
private interpanLock: boolean;
private queue: Queue;
private closing: boolean;
private deprecatedTimer: NodeJS.Timeout;


public constructor(networkOptions: NetworkOptions,
Expand Down Expand Up @@ -165,11 +166,19 @@ class EZSPAdapter extends Adapter {
* Adapter methods
*/
public async start(): Promise<StartResult> {
const logEzspDeprecated = (): void => {
const message = `Deprecated driver 'ezsp' currently in use, 'ember' will become the officially supported EmberZNet ` +
`driver in next release. If using Zigbee2MQTT see https://github.com/Koenkk/zigbee2mqtt/discussions/21462`;
logger.warning(message, NS);
};
logEzspDeprecated();
this.deprecatedTimer = setInterval(logEzspDeprecated, 60 * 60 * 1000); // Every 60 mins
return this.driver.startup();
}

public async stop(): Promise<void> {
this.closing = true;
clearInterval(this.deprecatedTimer);
await this.driver.stop();
}

Expand Down

0 comments on commit d55a267

Please sign in to comment.