Skip to content

Commit

Permalink
Fix Homebridge SIGTERM on network error with Node 16.
Browse files Browse the repository at this point in the history
  • Loading branch information
adriancable committed May 2, 2022
1 parent c9e59c5 commit 2b8a2e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
[![Discord](https://img.shields.io/discord/432663330281226270?color=728ED5&logo=discord&label=discord)](https://discord.gg/j5WwJTB)

Nest plug-in for [Homebridge](https://github.com/nfarina/homebridge) using the native Nest API. See what's new in [release 4.6.8](https://github.com/chrisjshull/homebridge-nest/releases/tag/v4.6.8).
Nest plug-in for [Homebridge](https://github.com/nfarina/homebridge) using the native Nest API. See what's new in [release 4.6.9](https://github.com/chrisjshull/homebridge-nest/releases/tag/v4.6.9).

Integrate your Nest Thermostat, Temperature Sensors, Nest Protect, and Nest x Yale Lock devices into your HomeKit system. Both Nest Accounts (pre-August 2019) and Google Accounts are supported.

Expand Down
12 changes: 4 additions & 8 deletions lib/nest-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,8 @@ class Connection {
this.cancelObserveTimer = null;
this.pingTimer = null;

attempt(() => req.removeAllListeners(), 'cleanAndReject: request remove listeners error -');
attempt(() => client.removeAllListeners(), 'cleanAndReject: client remove listeners error -');
attempt(() => req.destroy(), 'cleanAndReject: request destroy error -');
attempt(() => client.destroy(), 'cleanAndReject: client destroy error -');
attempt(() => req.destroy(), 'cleanAndResolve: request destroy error -');
attempt(() => client.destroy(), 'cleanAndResolve: client destroy error -');

res(val);
};
Expand All @@ -545,10 +543,8 @@ class Connection {
this.cancelObserveTimer = null;
this.pingTimer = null;

attempt(() => req.removeAllListeners(), 'cleanAndResolve: request remove listeners error -');
attempt(() => client.removeAllListeners(), 'cleanAndResolve: client remove listeners error -');
attempt(() => req.destroy(), 'cleanAndResolve: request destroy error -');
attempt(() => client.destroy(), 'cleanAndResolve: client destroy error -');
attempt(() => req.destroy(), 'cleanAndReject: request destroy error -');
attempt(() => client.destroy(), 'cleanAndReject: client destroy error -');

rej(val);
};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
"prepublishOnly": "npm run lint",
"preversion": "npm run lint"
},
"version": "4.6.8",
"version": "4.6.9",
"warnings": [
{
"code": "ENOTSUP",
"required": {
"node": ">=7.0.0",
"homebridge": ">=0.2.5"
},
"pkgid": "[email protected].8"
"pkgid": "[email protected].9"
}
]
}

0 comments on commit 2b8a2e0

Please sign in to comment.