Skip to content

Commit

Permalink
Fixed models dropdown menu bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CJNE committed Dec 13, 2021
1 parent 4226e04 commit 4d71b42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/sunspec/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ async def _show_config_form(self, user_input): # pylint: disable=unused-argumen
async def _show_settings_form(self, user_input): # pylint: disable=unused-argument
"""Show the configuration form to edit settings data."""
models = set(await self.client.async_get_models())
model_filter = {str(model): str(model) for model in sorted(models)}
model_filter = {str(model) for model in sorted(models)}
default_enabled = {str(model) for model in DEFAULT_MODELS if model in models}
return self.async_show_form(
step_id="settings",
data_schema=vol.Schema(
Expand All @@ -107,7 +108,7 @@ async def _show_settings_form(self, user_input): # pylint: disable=unused-argum
): int,
vol.Optional(
CONF_ENABLED_MODELS,
default=DEFAULT_MODELS,
default=default_enabled,
): cv.multi_select(model_filter),
}
),
Expand Down

0 comments on commit 4d71b42

Please sign in to comment.