mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +00:00
Enable the LIFX diagnostic buttons by default (#76389)
This commit is contained in:
parent
89e0db3548
commit
d14b76e7fc
@ -19,14 +19,12 @@ RESTART_BUTTON_DESCRIPTION = ButtonEntityDescription(
|
||||
key=RESTART,
|
||||
name="Restart",
|
||||
device_class=ButtonDeviceClass.RESTART,
|
||||
entity_registry_enabled_default=False,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
)
|
||||
|
||||
IDENTIFY_BUTTON_DESCRIPTION = ButtonEntityDescription(
|
||||
key=IDENTIFY,
|
||||
name="Identify",
|
||||
entity_registry_enabled_default=False,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
)
|
||||
|
||||
|
@ -43,18 +43,9 @@ async def test_button_restart(hass: HomeAssistant) -> None:
|
||||
entity_registry = er.async_get(hass)
|
||||
entity = entity_registry.async_get(entity_id)
|
||||
assert entity
|
||||
assert entity.disabled
|
||||
assert not entity.disabled
|
||||
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(
|
||||
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 = entity_registry.async_get(entity_id)
|
||||
assert entity
|
||||
assert entity.disabled
|
||||
assert not entity.disabled
|
||||
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(
|
||||
BUTTON_DOMAIN, "press", {ATTR_ENTITY_ID: entity_id}, blocking=True
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user