(self, user_input=None)
return self.async_show_form(
            step_id="init", data_schema=vol.Schema(options_schema), errors=errors
        )
Handle options flow.
Handle options flow.
Handle options flow .
async def async_step_init(self, user_input=None):
        """Handle options flow."""
        conf = self.config_entry
        if conf.source == config_entries.SOURCE_IMPORT:
            return self.async_show_form(step_id="init", data_schema=None)
        errors = {}
        if user_input is not None:
            validate_options(user_input, errors)
            if not errors:
                return self.async_create_entry(title="", data=user_input)

        all_lights = [
            light
            for light in self.hass.states.async_entity_ids("light")
            if _supported_features(self.hass, light)
        ]
        to_replace = {CONF_LIGHTS: cv.multi_select(sorted(all_lights))}

        options_schema = {}
        for name, default, validation in VALIDATION_TUPLES:
            key = vol.Optional(name, default=conf.options.get(name, default))
            value = to_replace.get(name, validation)
            options_schema[key] = value

        return self.async_show_form(
            step_id="init", data_schema=vol.Schema(options_schema), errors=errors
        )
async def async_step_init ( self , user_input = None ) : conf = self . config_entry if conf . source == config_entries . SOURCE_IMPORT : return self . async_show_form ( step_id = "init" , data_schema = None ) errors = { } if user_input is not None : validate_options ( user_input , errors ) if not errors : return self . async_create_entry ( title = "" , data = user_input ) all_lights = [ light for light in self . hass . states . async_entity_ids ( "light" ) if _supported_features ( self . hass , light ) ] to_replace = { CONF_LIGHTS : cv . multi_select ( sorted ( all_lights ) ) } options_schema = { } for name , default , validation in VALIDATION_TUPLES : key = vol . Optional ( name , default = conf . options . get ( name , default ) ) value = to_replace . get ( name , validation ) options_schema [ key ] = value return self . async_show_form ( step_id = "init" , data_schema = vol . Schema ( options_schema ) , errors = errors )