-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Resetting time field in Config Flow has wrong behavior #24405
Comments
Could it be that some fields are required and some are optional, which could explain the difference? Maybe you can attach the example config schema passed to frontend, and the response value as additional information. |
Sure. Example when the optional time fields are not filled: Example when one of the optional fields is filled: Example when one of the fields is filled and then I click on the 'X' and it resets the field like it wasn't filled (in this case 'hour_2' is not passed on the payload): |
I can't convince myself that this is actually the wrong behavior. I don't see any reason why it should be expected it to return null instead of undefined. I see the same behavior for textfields as well. If you backspace the text in an optional textfield to empty, that key is also not returned in the config flow response. Is there a particular reason you expected it to be the other way? The only way I can even get a time field to be null is if I pass in default=None, (instead of just omitting the default) and that doesn't even seem to work when I try to submit it: |
Is your config flow code posted online anywhere? |
Checklist
Describe the issue you are experiencing
When I'm filling the configuration of an integration in a Config Flow and it has time input fields, if I fill out a field and then click on 'X' to erase the data on the field, what is passed as payload is that every input that was not filled is null, the field that was erased disappears from the payload.
Describe the behavior you expected
I expected the field which data was erased should have been passed as null like the others
Steps to reproduce the issue
1.Add an Integration which has in it's configuration a time selector field
2.Fill in the field
3.Erase the data on the field by clicking on the -X-
4.Inspect the payload being submitted when you press Next
...
What version of Home Assistant Core has the issue?
core-2025.2.5
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue?
Google Chrome 133.0.6943.99 (Official Build) (64-bit)
Which operating system are you using to run this browser?
Windows 11 Enterprise 23H2
State of relevant entities
Problem-relevant frontend configuration
Javascript errors shown in your browser console/inspector
Additional information
No response
The text was updated successfully, but these errors were encountered: