Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This new code checks the capabilities of every device before sending a new overlay, including all of them or a default value. That ensures no error saying "no compatible setting" or "missing setting".
This was motivated because I had problems with Tado Smart AC v3 devices. I have 4 of them with 4 AC machines in 4 different rooms. Moreover, I use Home Assistant. The problem was that 2 of them needs different payload data when you want to set a new overlay. It is even different depending on the mode you are using: heat/cool and dry/fan need different settings in the payload.
It was a bit crazy, then, so I wrote this code that works for "any capabilities", because it checks what settings are waited by the device/zone before executing the PUT for the new overlay.