Custom PS3 Integration: Issues with config flow

Hi all!

I am having some issues with my config flow. I added a SelectSelector (dropdown) to select a script in further functionalities in the integration. This is optional however.

I am now facing the issue that if I don’t select any script, I get the following error:

image

I suspect this is because of some constraints in the SelectSelector class as I have made it an optional field. Is there any way to circumvent this? The code for the config_flow can be consulted here: ps3-home-assistant/custom_components/ps3/config_flow.py at 0ec9c641076a5c5a2cff480ebfc68c0ea39e6102 · SDR3078/ps3-home-assistant · GitHub.

Thanks!

Don’t set a default value in your selector. So just:

                    vol.Optional(TURN_ON_SCRIPT): SelectSelector(
                        SelectSelectorConfig(
                            options = [value.unique_id for value in self.hass.data["entity_registry"].entities.values() if value.platform == 'script'], 
                            mode = SelectSelectorMode.DROPDOWN
                            )
                        )