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

[homeconnect] Selected program not set at startup when program state is finished #10904

Closed
lolodomo opened this issue Jun 27, 2021 · 10 comments · Fixed by #10929
Closed

[homeconnect] Selected program not set at startup when program state is finished #10904

lolodomo opened this issue Jun 27, 2021 · 10 comments · Fixed by #10929
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@lolodomo
Copy link
Contributor

lolodomo commented Jun 27, 2021

If you start the binding while the current state of the program is "finished", the "selected program" channel is not set.
This is apparently linked to the fact the binding tries to retrieve the available options for this program and it fails (code 409 - Request cannot be performed in the current operation state) when the program is in this state. This leads to multiple calls.
image
The channel should be set even if retrieving of program options is not yet possible.
The result would be certainly the same if the program state was "running".

@lolodomo lolodomo added the bug An unexpected problem or unintended behavior of an add-on label Jun 27, 2021
@lolodomo lolodomo changed the title [homeconnect] Selected program not set when program state is finished [homeconnect] Selected program not set at startup when program state is finished Jun 27, 2021
@lolodomo
Copy link
Contributor Author

@bruestel : this is a problem with exception not being caught.
I see several cases in AbstractHomeConnectThingHandler where no exception is caught when calling the REST API. Was there a logic in that ?

@bruestel
Copy link
Contributor

Exceptions should be caught at any time. There is an exception when executing OH commands. Errors are only logged here.

Can you tell me which part you mean exactly. I'll have a look at it.

@lolodomo
Copy link
Contributor Author

lolodomo commented Jun 30, 2021

@lolodomo
Copy link
Contributor Author

lolodomo commented Jul 3, 2021

In fact, exceptions are caught in method updateChannel.
But it sometimes should be done at deeper level to not break the channel update.

lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Jul 3, 2021
Fix openhab#10904

Signed-off-by: Laurent Garnier <lg.hc@ree.fr>
@lolodomo
Copy link
Contributor Author

lolodomo commented Jul 3, 2021

I am working on a patch.

lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Jul 3, 2021
Fix openhab#10904

Signed-off-by: Laurent Garnier <lg.hc@ree.fr>
lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Jul 3, 2021
Fix openhab#10904

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@lolodomo
Copy link
Contributor Author

lolodomo commented Jul 3, 2021

@bruestel : I finally found only 3 places (methods) requiring an additional exception catching.

The uncaught exception was also the cause of the repeated calls (for each channel) as the cache was not filled.

@lolodomo
Copy link
Contributor Author

lolodomo commented Jul 3, 2021

Unfortunately, when the program state is updated, there is no retry to load the program options. They will be loaded only when the program is updated. Maybe something else to improve.

@lolodomo
Copy link
Contributor Author

lolodomo commented Jul 4, 2021

The result would be certainly the same if the program state was "running".

In fact, it is not. The request succeeded while the program is running but I discovered that not all options are returned. I got the available spin speeds but not the available washing temperatures. I guess this is because you cannot change the washing temperature while the program is started but you can still adjust the spin speed (when you are at the beginning of the program).

This could lead to incomplete options being cached by the binding. Maybe we should cache the result only if all expected options are returned.

@lolodomo
Copy link
Contributor Author

lolodomo commented Jul 4, 2021

Maybe we should cache the result only if all expected options are returned.

This enhancement is now included in my PR.

@bruestel
Copy link
Contributor

bruestel commented Jul 5, 2021

Thank you for your PR. LGTM.

In fact, it is not. The request succeeded while the program is running but I discovered that not all options are returned. I got the available spin speeds but not the available washing temperatures. I guess this is because you cannot change the washing temperature while the program is started but you can still adjust the spin speed (when you are at the beginning of the program).

I like how you solved this.

kaikreuzer pushed a commit that referenced this issue Jul 11, 2021
* [homeconnect] Catch exception when appropriate

Fix #10904

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
computergeek1507 pushed a commit to computergeek1507/openhab-addons that referenced this issue Jul 13, 2021
* [homeconnect] Catch exception when appropriate

Fix openhab#10904

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
frederictobiasc pushed a commit to frederictobiasc/openhab-addons that referenced this issue Oct 26, 2021
* [homeconnect] Catch exception when appropriate

Fix openhab#10904

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this issue Nov 7, 2021
* [homeconnect] Catch exception when appropriate

Fix openhab#10904

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this issue May 5, 2022
* [homeconnect] Catch exception when appropriate

Fix openhab#10904

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants