JeroenVdb / homebridge-daikin-cloud

This Homebrige plugin connects to the Daikin Cloud and loads all your devices to be controled via Homebridge and Homekit.
https://www.npmjs.com/package/homebridge-daikin-cloud
Apache License 2.0
40 stars 11 forks source link

TypeError: server.closeAllConnections is not a function after authorization. #82

Closed Tangheta closed 3 weeks ago

Tangheta commented 2 months ago

Describe The Bug: Now that the applications issue on Daikin is resolved, it is still not working to authorize.

To Reproduce: Create an app on Daikin, provide info in the plugin. The authorization URL will work. After approving, you're redirected to the local Thank you page. (Authorization complete). But in the logs, the plugin crashes and restarts.

Logs:

Daikin Cloud BridgeErrorTypeError: server.closeAllConnections is not a function at cleanup (/var/lib/hoobs/daikincloudbridge/node_modules/daikin-controller-cloud/src/onecta/oidc-callback-server.ts:80:24) at onAuthCode (/var/lib/hoobs/daikincloudbridge/node_modules/daikin-controller-cloud/src/onecta/oidc-callback-server.ts:92:17) at ServerResponse. (/var/lib/hoobs/daikincloudbridge/node_modules/daikin-controller-cloud/src/onecta/oidc-callback-server.ts:102:46) at Object.onceWrapper (node:events:627:28) at ServerResponse.emit (node:events:525:35) at onFinish (node:_http_outgoing:950:10) at callback (node:internal/streams/writable:554:21) at afterWrite (node:internal/streams/writable:499:5) at onwrite (node:internal/streams/writable:479:7) at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:106:10)

JeroenVdb commented 1 month ago

What version of node are you using @Tangheta? You must use at least 18.15.0 or up. It looks like you are using a lower version that doesn't yet support closeAllConnections.