Skip to content

Commit

Permalink
⚙ improve for config flow
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Sep 15, 2024
1 parent f5a8935 commit efb179e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/xiaomi_miot/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,18 @@ async def get_cloud_filter_schema(hass, user_input, errors, schema=None, via_did
grp.setdefault(v, 0)
grp[v] += 1
vls.setdefault(f, {})
dnm = f'{d.get("name")}'
des = '<empty>' if v == '' else v
if f == 'home_id':
des = d.get('home_name') or des
if f in ['did']:
if MiotCloud.is_hide(d):
continue
dip = d.get('localip')
if not dip or d.get('pid') not in ['0', '8', '', None]:
if not dip or d.get('pid') not in [0, '0', '8', '', None]:
dip = d.get('model')
vls[f][v] = f'{d.get("name")} ({dip})'
vls[f][v] = f'{dnm} ({dip})'
elif f in ['model']:
dnm = f'{d.get("name")}'
if grp[v] > 1:
dnm += f' * {grp[v]}'
vls[f][v] = f'{des} ({dnm})'
Expand Down

0 comments on commit efb179e

Please sign in to comment.