Skip to content
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

[freeboxos] Avoid useless API requests (server/player) #17237

Merged
merged 4 commits into from
Aug 13, 2024

Conversation

lolodomo
Copy link
Contributor

Avoids API requests when channels are unlinked.

Signed-off-by: Laurent Garnier lg.hc@free.fr

Avoids API requests when channels are unlinked.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@lolodomo lolodomo added the enhancement An enhancement or new feature for an existing add-on label Aug 12, 2024
@lolodomo lolodomo requested a review from clinique as a code owner August 12, 2024 13:39
@clinique
Copy link
Contributor

Let me know the outcome of this in term of requests decrease.
Do you have a specific concern regarding network load ?

Copy link
Contributor

@clinique clinique left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lolodomo
Copy link
Contributor Author

lolodomo commented Aug 12, 2024

Let me know the outcome of this in term of requests decrease.

For the Revolution server, it can be 9 calls less, depending on what channels are linked. The minimum number of calls is now one call, the max is 10 calls. If all non advanced channels are linked, this will be 5 calls now, instead of 10 calls before. So a gain of 50%.

For the (active) player, it is just one call less, depending on what channels are linked. The minimum number of calls is now 2 calls, the max is 3 calls.

Do you have a specific concern regarding network load ?

No

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the optimization. I have left only some minor optional comments for consideration.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@jlaur jlaur changed the title [freeboxos] Avoids useless API requests (server/player) [freeboxos] Avoid useless API requests (server/player) Aug 13, 2024
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @lolodomo, I assume you will review and merge #17219. Please coordinate with @clinique which should go first, as I think they will conflict.

@lolodomo
Copy link
Contributor Author

@lolodomo, I assume you will review and merge #17219. Please coordinate with @clinique which should go first, as I think they will conflict.

Let's go with mine (this one) first, the place I created the method will make it available in all thing handlers. @clinique will then rebase his PR.

@jlaur jlaur requested a review from clinique August 13, 2024 14:14
@jlaur jlaur merged commit d6cac81 into openhab:main Aug 13, 2024
5 checks passed
@jlaur jlaur added this to the 4.3 milestone Aug 13, 2024
@lolodomo
Copy link
Contributor Author

Thank you @jlaur

@lolodomo lolodomo deleted the freeboxos_reduce_api_calls branch August 13, 2024 14:39
digitaldan pushed a commit to digitaldan/openhab-addons that referenced this pull request Aug 29, 2024
pgfeller pushed a commit to pgfeller/openhab-addons that referenced this pull request Sep 29, 2024
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
joni1993 pushed a commit to joni1993/openhab-addons that referenced this pull request Oct 15, 2024
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Oct 18, 2024
chilobo pushed a commit to chilobo/openhab-addons that referenced this pull request Nov 20, 2024
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Christian Koch <christian@koch-bensheim.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants