Closed sanjay900 closed 1 year ago
@mag1024 Unfortunately, it seems like optional and the options config flow just don't play nice with each other.
Home assistants docs tell you to use the default value for making it so that when the options flow loads, it shows the previously set values, but when you do that, that value also gets used if you don't fill in the box, meaning you no longer are able to make it optional
Weirdly though, i see people doing exactly what im doing in other integrations when i search on github, so now im just confused
Ah, figured it out. Theres a different method you can use to provide the default value, and that seems to work perfectly.
Ive also changed the option to support strings, so a user can either use a passcode or just a password, and then the code input will reflect what they choose.
Nice thing is this lets us break out the schema too, which cleans things up as well. Not sure why they don't document this on the page about options flows
Nice!
When I changed to using the CONF_CODE const, i missed updating the translations file.