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

[velux] Bridge status shows offline when communication fails #13406

Merged
merged 7 commits into from
Sep 25, 2022

Conversation

andrewfg
Copy link
Contributor

Resolves #13383

Background

As reported in issue #13383 the bridge thing does not indicate offline status when when the communication fails.

Solution

In this PR the bridge thing status will change to offline when the communication fails, and return to online when it is restored.

Signed-off-by: Andrew Fiddian-Green software@whitebear.ch

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg added the enhancement An enhancement or new feature for an existing add-on label Sep 18, 2022
@andrewfg andrewfg requested a review from gs4711 as a code owner September 18, 2022 10:52
@andrewfg andrewfg self-assigned this Sep 18, 2022
@lolodomo
Copy link
Contributor

Your approach is relatively unusual.
You don't want to adjust the thing status at each command?

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg
Copy link
Contributor Author

Your approach is relatively unusual.
You don't want to adjust the thing status at each command?

I agree with you that it is rather unusual (I did not write this part of the code). However you may have missed the peculiarity that the handleCommandCommsJob() method is called both from the core handleCommand() (for handling commands from the core), and also from the polling scheduler (with the RefreshType command argument to refresh the channels). This means that the status will indeed be checked on each command received from the core, but it will ALSO be checked with each poller refresh "command" from the scheduler. And it is really the latter that we are interested in for this case.

@andrewfg andrewfg requested a review from lolodomo September 18, 2022 16:21
Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

@lolodomo lolodomo merged commit 79309cb into openhab:main Sep 25, 2022
@lolodomo lolodomo added this to the 3.4 milestone Sep 25, 2022
@andrewfg andrewfg deleted the 13383-velux-offline branch September 26, 2022 16:08
leifbladt pushed a commit to leifbladt/openhab-addons that referenced this pull request Oct 15, 2022
…#13406)

* [velux] dynamically update bridge on-/off- line state

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
seime pushed a commit to seime/openhab2-addons that referenced this pull request Oct 16, 2022
…#13406)

* [velux] dynamically update bridge on-/off- line state

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
…#13406)

* [velux] dynamically update bridge on-/off- line state

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
…#13406)

* [velux] dynamically update bridge on-/off- line state

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
borazslo pushed a commit to borazslo/openhab-mideaac-addon that referenced this pull request Jan 8, 2023
…#13406)

* [velux] dynamically update bridge on-/off- line state

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
…#13406)

* [velux] dynamically update bridge on-/off- line state

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
…#13406)

* [velux] dynamically update bridge on-/off- line state

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
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.

[velux] Bridge Thing remains ONLINE even though connection can't be established
2 participants