Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Log EZSP adapter deprecated #1039

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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