Skip to content

Commit

Permalink
Fix options flow
Browse files Browse the repository at this point in the history
  • Loading branch information
basbruss committed Jun 17, 2024
1 parent 37f5cc5 commit d0fa820
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions custom_components/adaptive_cover/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,16 +606,15 @@ async def async_step_update(self, user_input: dict[str, Any] | None = None):
CONF_MIN_ELEVATION: self.config.get(CONF_MIN_ELEVATION, None),
CONF_MAX_ELEVATION: self.config.get(CONF_MAX_ELEVATION, None),
CONF_TRANSPARENT_BLIND: self.config.get(CONF_TRANSPARENT_BLIND, False),
CONF_INTERP: self.config.get(CONF_INTERP),
CONF_INTERP_START: self.config.get(CONF_INTERP_START, None),
CONF_INTERP_END: self.config.get(CONF_INTERP_END, None),
CONF_INTERP_LIST: self.config.get(CONF_INTERP_LIST, []),
CONF_INTERP_LIST_NEW: self.config.get(CONF_INTERP_LIST_NEW, []),
CONF_INTERP: self.config.get(CONF_INTERP),
CONF_LUX_ENTITY: self.config.get(CONF_LUX_ENTITY),
CONF_LUX_THRESHOLD: self.config.get(CONF_LUX_THRESHOLD),
CONF_IRRADIANCE_ENTITY: self.config.get(CONF_IRRADIANCE_ENTITY),
CONF_IRRADIANCE_THRESHOLD: self.config.get(CONF_IRRADIANCE_THRESHOLD),

},
)

Expand Down Expand Up @@ -696,6 +695,10 @@ async def async_step_vertical(self, user_input: dict[str, Any] | None = None):
},
)
self.options.update(user_input)
if self.options.get(CONF_INTERP, False):
return await self.async_step_interp()
if self.options[CONF_ENABLE_BLIND_SPOT]:
return await self.async_step_blind_spot()
if self.options[CONF_CLIMATE_MODE]:
return await self.async_step_climate()
return await self._update_options()
Expand Down Expand Up @@ -791,8 +794,11 @@ async def async_step_interp(self, user_input: dict[str, Any] | None = None):
)
self.options.update(user_input)
return await self._update_options()
return self.add_suggested_values_to_schema(
INTERPOLATION_OPTIONS, user_input or self.options
return self.async_show_form(
step_id="interp",
data_schema=self.add_suggested_values_to_schema(
INTERPOLATION_OPTIONS, user_input or self.options
),
)

async def async_step_blind_spot(self, user_input: dict[str, Any] | None = None):
Expand Down

0 comments on commit d0fa820

Please sign in to comment.