nibi79 / worxlandroid

openHAB Binding for Worx Landroid
60 stars 20 forks source link

Added reconnectInterval and changed polling to allow values > 599 seconds #79

Closed foobar26 closed 1 year ago

foobar26 commented 1 year ago

I played around a bit with the Pluigin and found a working solution. I replaced the polling every 10 minutes with a reconnect. Then I also set the polling to 60 minutes. This way you don't always get some info updates (e.g. when the mower is charging and the charging status changes), but you are not blocked and have full control over the mower all the time. You get all the updates while mowing. Status updates (e.g. when the cable is missing) are always received.

nibi79 commented 1 year ago

I just found a bug in your MowerConfiguration public void setReconnectInterval(int pollingInterval) { this.reconnectInterval = reconnectInterval; }

so are you sure you really reconnect every 10 minutes

nibi79 commented 1 year ago

it must be public void setReconnectInterval(int reconnectInterval) { this.reconnectInterval = reconnectInterval; }

foobar26 commented 1 year ago

Whoops, you are right! I'm very sorry I overlooked that one. A classical case of midnight programming :-) I put this one together quite quickly after doing a dirty implementation based on your code without additional config parameters. There it was definitely 10 minutes. This one is still running, just checked the logs:

2023-04-09 11:57:47.711 [INFO ] [id.internal.WorxLandroidMowerHandler] - reconnecting
2023-04-09 12:07:47.101 [INFO ] [id.internal.WorxLandroidMowerHandler] - reconnecting
2023-04-09 12:17:46.468 [INFO ] [id.internal.WorxLandroidMowerHandler] - reconnecting
foobar26 commented 1 year ago

Just fixed it in my repo if needed.

foobar26 commented 1 year ago

Sorry, just realized that there is an ugly INFO logging for the reconnecting still in the implementation. You might want to put this to debug level.

nibi79 commented 1 year ago

You might want to put this to debug level.

Done!