-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[boschindego] Provide faster channel updates #13192
Conversation
8356b20
to
9def385
Compare
Add position tracking (on map) Provide faster updates when active Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
9def385
to
00f2db7
Compare
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
5033779
to
56e5bb4
Compare
This PR is mostly an enhancement with faster updates and especially almost real-time map position tracking. However, the first mentioned point about operating data requests can be considered a fix for a regression in #12938. At that time I was not aware that this request would wake up the device, effectively keeping it awake all the time (poll frequency three minutes, time for going to sleep 10 minutes). Therefore it would be very nice to get ready in time for the first 3.4 milestone release to avoid potentially a lot of robots being contacted through the service way too many times. Potentially Bosch could take counter-measures and we could get into the same situation as the Gardena binding with HTTP error 429 ("Too Many Requests"). While working on this PR I have only experienced that a single time during some heavy testing with binding, app and Postman performing requests simultaneously. FYI @openhab/add-ons-maintainers |
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank ypu
* Optimize API calls for reduced load * Add position tracking (on map) * Provide faster updates when active * Optimize state update after triggering commands * Clean up duration variables * Add initial test coverage for DeviceStatus Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Optimize API calls for reduced load * Add position tracking (on map) * Provide faster updates when active * Optimize state update after triggering commands * Clean up duration variables * Add initial test coverage for DeviceStatus Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Optimize API calls for reduced load * Add position tracking (on map) * Provide faster updates when active * Optimize state update after triggering commands * Clean up duration variables * Add initial test coverage for DeviceStatus Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
* Optimize API calls for reduced load * Add position tracking (on map) * Provide faster updates when active * Optimize state update after triggering commands * Clean up duration variables * Add initial test coverage for DeviceStatus Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Optimize API calls for reduced load * Add position tracking (on map) * Provide faster updates when active * Optimize state update after triggering commands * Clean up duration variables * Add initial test coverage for DeviceStatus Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This pull request implements a balanced way of using the API in order to provide faster updates and reduced load when fast updates are not needed. In addition, position tracking is now automatically requested when mower is active. This allows for updating the map with a frequency as high as six seconds between refreshes.
Some details:
/operatingData
(contacting the robot), was previously called every three minutes (with default configuration). This has now been changed to every six hours when idle and every two minutes when active or charging. For a mower running one hour every day and charging 30 minutes, this reduces the number of calls per day from 480 to 49 while at the same time providing faster updates. It also fixes an issue with the display being always on, since this call wakes up the device./state
, was previously called every three minutes (with default configuration). This has now been changed to every three minutes when idle, every two minutes when charging and every 30 seconds when active (in which case the result now includes updated map positions). For the same mower example, this increases the number of calls from 480 to 585 if the map channel is linked.Related to: