Skip to content

Commit

Permalink
🔧 improve for config flow (#2002)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Dec 13, 2024
1 parent c08bfc9 commit ce011d5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions custom_components/xiaomi_miot/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ async def async_step_cloud(self, user_input=None):
schema.update({
vol.Required('captcha', default=''): str,
})
if user_input.get('trans_options') == None:
user_input['trans_options'] = False
schema.update({
vol.Required(CONF_USERNAME, default=user_input.get(CONF_USERNAME, vol.UNDEFINED)): str,
vol.Required(CONF_PASSWORD, default=user_input.get(CONF_PASSWORD, vol.UNDEFINED)): str,
Expand Down Expand Up @@ -715,9 +717,9 @@ async def async_step_cloud_filter(self, user_input=None):
cfg.update({
CONF_CONN_MODE: prev_input.get(CONF_CONN_MODE),
'filter_models': self.filter_models,
'trans_options': prev_input.get('trans_options'),
'disable_message': prev_input.get('disable_message'),
'disable_scene_history': prev_input.get('disable_scene_history'),
'trans_options': prev_input.get('trans_options', False),
'disable_message': prev_input.get('disable_message', False),
'disable_scene_history': prev_input.get('disable_scene_history', False),
**user_input,
})
if self.filter_models:
Expand Down

0 comments on commit ce011d5

Please sign in to comment.