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
Fix home connect remaining progress time #109525
Fix home connect remaining progress time #109525
Conversation
The home connect API is sending some default values (on dishwashers) for the remaining progress time after the program finished. This is a problem because this value is stored and on every API event, for example opening the door of a dishwasher, the value for remaining progress time is updated with this wrong value. So I see a wrong value the whole time the dishwasher is not running and therefore has no remaining progress time. This coming fixes this problem and adds a check if the appliance is in running, pause or finished state, because there we have valid data. In the other states the new code just returns none like on other edge cases. Now there is no value if there is no program running.
Hey there @DavidMStraub, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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.
Please solve the lint failures.
|
check if BSH_OPERATION_STATE and ATTR_VALUE key values exist before accessing them later in the elif statement
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.
Thanks!
* fix remaining progress time for home connect component The home connect API is sending some default values (on dishwashers) for the remaining progress time after the program finished. This is a problem because this value is stored and on every API event, for example opening the door of a dishwasher, the value for remaining progress time is updated with this wrong value. So I see a wrong value the whole time the dishwasher is not running and therefore has no remaining progress time. This coming fixes this problem and adds a check if the appliance is in running, pause or finished state, because there we have valid data. In the other states the new code just returns none like on other edge cases. Now there is no value if there is no program running. * fix some formating according to the ruff rules * fix some formating according to the ruff rules again * fix alphabetic order of imports * add check if keys exist in dict before accessing them check if BSH_OPERATION_STATE and ATTR_VALUE key values exist before accessing them later in the elif statement * fix formating because forgotten local ruff run
Proposed change
The home connect API is sending some default values (on dishwashers) for the remaining progress time after the program finished. This is a problem because this value is stored and on every API event, for example opening the door of a dishwasher, the value for remaining progress time is updated with this wrong value. So I see a wrong value the whole time the dishwasher is not running and therefore has no remaining progress time. This coming fixes this problem and adds a check if the appliance is in running, pause or finished state, because there we have valid data. In the other states the new code just returns none like on other edge cases. Now there is no value if there is no program running.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: