diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa7a47b..c4ce93b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: name: Build & Deploy to NPM # Only run this job if initiator is not the Homey Github Actions Bot to prevent loops - if: github.actor != 'HomeyGithubActionsBot' && github.ref == 'refs/heads/production' + if: github.actor != 'homey-bot' && github.ref == 'refs/heads/production' runs-on: ubuntu-latest steps: diff --git a/remote/client.js b/remote/client.js index 5439879..3706fb5 100644 --- a/remote/client.js +++ b/remote/client.js @@ -103,6 +103,18 @@ class DeviceHandleProxy extends Duplex { static get constants() { return CONSTANTS; } + + /** + * Disconnect the remote socket.io connection. + * Call this when done using all device handles to allow the process to exit. + */ + static async disconnect() { + if (server) { + const serv = await server; + serv.disconnect(); + server = null; + } + } } DeviceHandleProxy.prototype.__init = makeRemoteFunc('create_handle');