stvmallen / homebridge-roomba-stv

Homebrige plugin for Roomba 9xx
MIT License
38 stars 15 forks source link

Added keepAlive refresh mode & bugfixes #15

Closed matanelgabsi closed 5 years ago

matanelgabsi commented 6 years ago

Hi there! Great plugin, using it for a few days and loved it. Unfortunately, when I started using it, I noticed that my Home app marks my accessories as "updating" all the time :(

I looked at the code, and found 2 issues:

  1. There was a binary or (|) instead of an logical or (||)
  2. When the current status was fetching, the status was inaccessible (was changed to "fetching"), this led to a few seconds (around 8 in my case) when the app would hand, as it was waiting for a status. if my polling interval was around 40S, this will cause the app to hand about 1/4 of the time... A better approach would be to use the last status always, even if we are currently updating..

In addition to fixing this bugs, I added a new mode: keepAlive. This keeps the connection to Roomba alive, and updates the status when Roomba posts updated, without any delay.

Also changed the docs to reflect all those change.

I would greatly appreciate if you could review this changes and merge them. Thanks!

esteban-mallen commented 5 years ago

@matanelgabsi OMG I just noticed this PR and it looks amazing! Let me take it for a test drive for a couple of days and merge it if everything goes ok