Allow to reorder members within a group (#149003)

This commit is contained in:
Paul Bottein 2025-07-26 01:07:51 +02:00 committed by GitHub
parent aab7381553
commit e017dc80a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,12 +56,12 @@ async def basic_group_options_schema(
entity_selector: selector.Selector[Any] | vol.Schema entity_selector: selector.Selector[Any] | vol.Schema
if handler is None: if handler is None:
entity_selector = selector.selector( entity_selector = selector.selector(
{"entity": {"domain": domain, "multiple": True}} {"entity": {"domain": domain, "multiple": True, "reorder": True}}
) )
else: else:
entity_selector = entity_selector_without_own_entities( entity_selector = entity_selector_without_own_entities(
cast(SchemaOptionsFlowHandler, handler.parent_handler), cast(SchemaOptionsFlowHandler, handler.parent_handler),
selector.EntitySelectorConfig(domain=domain, multiple=True), selector.EntitySelectorConfig(domain=domain, multiple=True, reorder=True),
) )
return vol.Schema( return vol.Schema(
@ -78,7 +78,9 @@ def basic_group_config_schema(domain: str | list[str]) -> vol.Schema:
{ {
vol.Required("name"): selector.TextSelector(), vol.Required("name"): selector.TextSelector(),
vol.Required(CONF_ENTITIES): selector.EntitySelector( vol.Required(CONF_ENTITIES): selector.EntitySelector(
selector.EntitySelectorConfig(domain=domain, multiple=True), selector.EntitySelectorConfig(
domain=domain, multiple=True, reorder=True
),
), ),
vol.Required(CONF_HIDE_MEMBERS, default=False): selector.BooleanSelector(), vol.Required(CONF_HIDE_MEMBERS, default=False): selector.BooleanSelector(),
} }