Skip to content

Commit

Permalink
🛠️ deprecated customizing_entity
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Oct 29, 2024
1 parent ea6bbb0 commit 4f9f1b5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions custom_components/xiaomi_miot/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ async def async_step_user(self, user_input=None):
}
if self.hass.data[DOMAIN].get('entities', {}):
actions.update({
'customizing_device': 'Customizing device (自定义设备) <推荐>',
'customizing_entity': 'Customizing entity (自定义实体)',
'customizing_device': 'Customizing device (自定义设备)',
})
return self.async_show_form(
step_id='user',
Expand Down Expand Up @@ -383,7 +383,7 @@ async def async_step_cloud_filter(self, user_input=None):

async def async_step_customizing(self, user_input=None):
tip = ''
via = self.context.get('customizing_via') or 'customizing_entity'
via = self.context.get('customizing_via') or 'customizing_device'
self.context['customizing_via'] = via
entry = await self.async_set_unique_id(f'{DOMAIN}-customizes')
entry_data = copy.deepcopy(dict(entry.data) if entry else {})
Expand Down Expand Up @@ -490,6 +490,9 @@ async def async_step_customizing(self, user_input=None):
else:
tip = f'None entities in `{domain}`'
else:
tip = ('⚠️ 自定义实体后续可能会弃用,推荐通过设备型号**自定义设备**。\n'
'The Customization of entity may be deprecated in the future, '
'it is recommended to customize the device through the device model.')
schema.update({
vol.Required('domain', default=user_input.get('domain', vol.UNDEFINED)): vol.In(SUPPORTED_DOMAINS),
vol.Optional('only_main_entity', default=user_input.get('only_main_entity', True)): cv.boolean,
Expand Down

0 comments on commit 4f9f1b5

Please sign in to comment.