Enable the LIFX diagnostic buttons by default (#76389)

This commit is contained in:
Avi Miller 2022-08-08 04:45:26 +10:00 committed by GitHub
parent 89e0db3548
commit d14b76e7fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 22 deletions

View File

@ -19,14 +19,12 @@ RESTART_BUTTON_DESCRIPTION = ButtonEntityDescription(
key=RESTART, key=RESTART,
name="Restart", name="Restart",
device_class=ButtonDeviceClass.RESTART, device_class=ButtonDeviceClass.RESTART,
entity_registry_enabled_default=False,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
) )
IDENTIFY_BUTTON_DESCRIPTION = ButtonEntityDescription( IDENTIFY_BUTTON_DESCRIPTION = ButtonEntityDescription(
key=IDENTIFY, key=IDENTIFY,
name="Identify", name="Identify",
entity_registry_enabled_default=False,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
) )

View File

@ -43,18 +43,9 @@ async def test_button_restart(hass: HomeAssistant) -> None:
entity_registry = er.async_get(hass) entity_registry = er.async_get(hass)
entity = entity_registry.async_get(entity_id) entity = entity_registry.async_get(entity_id)
assert entity assert entity
assert entity.disabled assert not entity.disabled
assert entity.unique_id == unique_id assert entity.unique_id == unique_id
enabled_entity = entity_registry.async_update_entity(entity_id, disabled_by=None)
assert not enabled_entity.disabled
with _patch_discovery(device=bulb), _patch_config_flow_try_connect(
device=bulb
), _patch_device(device=bulb):
await hass.config_entries.async_reload(config_entry.entry_id)
await hass.async_block_till_done()
await hass.services.async_call( await hass.services.async_call(
BUTTON_DOMAIN, "press", {ATTR_ENTITY_ID: entity_id}, blocking=True BUTTON_DOMAIN, "press", {ATTR_ENTITY_ID: entity_id}, blocking=True
) )
@ -84,18 +75,9 @@ async def test_button_identify(hass: HomeAssistant) -> None:
entity_registry = er.async_get(hass) entity_registry = er.async_get(hass)
entity = entity_registry.async_get(entity_id) entity = entity_registry.async_get(entity_id)
assert entity assert entity
assert entity.disabled assert not entity.disabled
assert entity.unique_id == unique_id assert entity.unique_id == unique_id
enabled_entity = entity_registry.async_update_entity(entity_id, disabled_by=None)
assert not enabled_entity.disabled
with _patch_discovery(device=bulb), _patch_config_flow_try_connect(
device=bulb
), _patch_device(device=bulb):
await hass.config_entries.async_reload(config_entry.entry_id)
await hass.async_block_till_done()
await hass.services.async_call( await hass.services.async_call(
BUTTON_DOMAIN, "press", {ATTR_ENTITY_ID: entity_id}, blocking=True BUTTON_DOMAIN, "press", {ATTR_ENTITY_ID: entity_id}, blocking=True
) )