Disable by default smlight auto zigbee update switch (#126707)

disable by default auto zigbee update switch

Co-authored-by: Shay Levy <levyshay1@gmail.com>
This commit is contained in:
TimL 2024-10-05 07:56:11 +10:00 committed by GitHub
parent d01fb914a9
commit 6ee03460d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View File

@ -52,6 +52,7 @@ SWITCHES: list[SmSwitchEntityDescription] = [
translation_key="auto_zigbee_update",
entity_category=EntityCategory.CONFIG,
setting=Settings.ZB_AUTOUPDATE,
entity_registry_enabled_default=False,
state_fn=lambda x: x.auto_zigbee,
),
SmSwitchEntityDescription(

View File

@ -54,12 +54,12 @@ async def test_disabled_by_default_switch(
) -> None:
"""Test vpn enabled switch is disabled by default ."""
await setup_integration(hass, mock_config_entry)
for entity in ("vpn_enabled", "auto_zigbee_update"):
assert not hass.states.get(f"switch.mock_title_{entity}")
assert not hass.states.get("switch.mock_title_vpn_enabled")
assert (entry := entity_registry.async_get("switch.mock_title_vpn_enabled"))
assert entry.disabled
assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION
assert (entry := entity_registry.async_get(f"switch.mock_title_{entity}"))
assert entry.disabled
assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION
@pytest.mark.usefixtures("entity_registry_enabled_by_default")