I also tried things like cv.Any(None, cv.string) where cv is homeassistant.helpers.config_validation which results in a ValueError. I saw a lot of code samples using this, nothing is working for me.
With the above exampe I am not able to empty the field, see the gif here.
First I try to emtpy it (which is ignored, and when debugging the config flow the user_input contains the old string). Only thing working is replacing the content with a space.
I know this is a very old topic, and probably not relevant for you anymore, but I stumbled over it because I had the same issue, until I finally found it in the documentation. It is not very easy to find, so I thought I’d add it here as well, for other with the same question.
If you’d like to pre-fill data in the form, you have two options. The first is to use the default parameter. This will both pre-fill the field, and act as the default value in case the user leaves the field empty.
The other alternative is to use a suggested value - this will also pre-fill the form field, but will allow the user to leave it empty if the user so wishes.
Thank you @Olen for posting this after the fact! I was at this for a number of hours before stumbling across your post that fixed it within 2 minutes.
It would be even easier if someone could add an optional “suggested_value” argument (like the “default” argument") instead of using the “description” argument with a dictionary item of “suggested_value”.
Anyway, just wanted to let you know I appreciated your follow up efforts.