mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
Merge pull request #350 from danaues/missing_light_fix
Fix missing light entities in options list
This commit is contained in:
commit
1efbbe3bb7
1 changed files with 5 additions and 1 deletions
|
|
@ -14,7 +14,7 @@ from .const import ( # pylint: disable=unused-import
|
|||
NONE_STR,
|
||||
VALIDATION_TUPLES,
|
||||
)
|
||||
from .switch import _supported_features
|
||||
from .switch import _supported_features, validate
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -82,6 +82,7 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
|
|||
async def async_step_init(self, user_input=None):
|
||||
"""Handle options flow."""
|
||||
conf = self.config_entry
|
||||
data = validate(conf)
|
||||
if conf.source == config_entries.SOURCE_IMPORT:
|
||||
return self.async_show_form(step_id="init", data_schema=None)
|
||||
errors = {}
|
||||
|
|
@ -95,6 +96,9 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
|
|||
for light in self.hass.states.async_entity_ids("light")
|
||||
if _supported_features(self.hass, light)
|
||||
]
|
||||
for configured_light in data[CONF_LIGHTS]:
|
||||
if not configured_light in all_lights:
|
||||
all_lights.append(configured_light)
|
||||
to_replace = {CONF_LIGHTS: cv.multi_select(sorted(all_lights))}
|
||||
|
||||
options_schema = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue