jeff-winn / homebridge-automower-platform

A platform plugin for Homebridge to connect your Husqvarna Automower and Gardena Smart (BETA) robotic lawn mowers to Apple HomeKit.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected stream error in logs

jeff-winn opened this issue · comments

Describe The Bug:

An error is occurring on startup by the ws web socket where an unknown error is being handed off to the Gardena event stream client.

To Reproduce:

Use the Gardena device mode and login with a valid account that contains Gardena Devi es.

Expected behavior:

No error should occur.

Logs:

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.

Screenshots:

Mower:

  • Year:
  • Model:

Environment:

  • Plugin Version:
  • Homebridge Version:
  • Node.js Version:
  • Operating System:

This issue is associated with #286

Appears as though it’s calling connect twice, could be a race condition between the unexpected error showing up and disconnect attempting to automatically reconnect.

The init method shouldn’t be calling start on the service, the start method has it in there as well.

There is also a related issue when creating a second socket that Gardena will close the original socket unexpectedly causing an error with no details to show up. The error handler just needs to ignore when this happens.

Acceptance Criteria

  • Remove extra service start performed in the init method (referenced above).
  • Clean up the stop method to no longer use the values iterator directly in the loop, convert to an array first.