Skip to content

Commit

Permalink
Merge pull request #350 from danaues/missing_light_fix
Browse files Browse the repository at this point in the history
Fix missing light entities in options list
  • Loading branch information
basnijholt authored Oct 28, 2022
2 parents 6ea396a + 24c2800 commit 1efbbe3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/adaptive_lighting/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
NONE_STR,
VALIDATION_TUPLES,
)
from .switch import _supported_features
from .switch import _supported_features, validate

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -82,6 +82,7 @@ def __init__(self, config_entry: config_entries.ConfigEntry):
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 = {}
Expand All @@ -95,6 +96,9 @@ async def async_step_init(self, user_input=None):
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 = {}
Expand Down

0 comments on commit 1efbbe3

Please sign in to comment.