Allow device type WasherDryer for home_connect component#89113
Allow device type WasherDryer for home_connect component#89113DennisGaida wants to merge 4 commits into
Conversation
|
Hi @DennisGaida It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
|
Hey there @DavidMStraub, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
I've marked this PR, as some jobs in our CI are failing. Please check the output of those jobs to see what went wrong and adjust the PR accordingly. Please un-draft it once the CI passes and it is ready for review again by clicking the "Ready for review" button. Thanks! 👍 ../Frenck |
| {"name": "LaundryCare.Washer.Program.SportFitness"}, | ||
| {"name": "LaundryCare.Washer.Program.Towels"}, | ||
| {"name": "LaundryCare.Washer.Program.WaterProof"}, | ||
| # {"name": "LaundryCare.Dryer.Program.Cotton"}, |
There was a problem hiding this comment.
Why is there commented out code here?
Either remove it if it's not needed, or uncomment it if it's needed.
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
This PR is outdated, due to the latest changes done in the Home Connect integration programs fetching mechanism. |
|
Awesome, I didn't see any update concerning the statically typed list of program names which I didn't like at all. So I fully support the other / newer PR. Hopefully that one will be merged soon then... |
Proposed change
This PR adds the device type "WasherDryer" or a washing machine that can also dry. According to documentation it can pretty much do everything a dryer as well as what a washer can do. Additionally there are a couple of
WasherDryerprograms.Type of change
Additional information
All this PR does is add the possibility to connect a
WasherDryertype device. What is currently lacking is one thing:Currently the HA switch for programs is just generated by splitting the program name (e.g.
LaundryCare.Washer.Program.Cotton) at the last dot. Unfortunately this creates duplicate names such thatLaundryCare.Dryer.Program.CottonandLaundryCare.WasherDryer.Program.Cottonwould all just be "Cotton"This means if all programs were added to the current implementation you would get errors such as these:
I have currently commented out the duplicate keys, which means there is commented out code in this PR. To really fix this the whole
home_connectcomponent would need to be rewritten to be able to distinguish between the different program types (i.e. instead of "Program Cotton" the switch would need to be named "Program Cotton Dryer", "Program Cotton Washer" and "Program Cotton WasherDryer" or something like that) - the will be a complete rework of the home_connect component.The actual best practice is to use the
programs/get_available_programsendpoint per device instead of hardcoding the programs like the current implementation of the component does - again a complete rework of the home_connect component.I believe this PR would be a good start to make the
WasherDryerdevice type just work™, but ultimately the component should be rewritten to get the available programs via the API and create switches based on that and name these switches sensible instead of just splitting the key (the programs actually all have friendly names when acquired via the API - still not unique, but friendly).Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
The documentation currently does not specify supported devices.
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: