1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Use disabled_by constants (#49584)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Ville Skyttä
2021-04-23 10:56:42 +03:00
committed by GitHub
parent d52bc2373f
commit a396619251
25 changed files with 92 additions and 75 deletions

View File

@@ -575,7 +575,7 @@ async def test_warn_disabled(hass, caplog):
entity_id="hello.world",
unique_id="test-unique-id",
platform="test-platform",
disabled_by="user",
disabled_by=entity_registry.DISABLED_USER,
)
mock_registry(hass, {"hello.world": entry})
@@ -616,7 +616,9 @@ async def test_disabled_in_entity_registry(hass):
await ent.add_to_platform_finish()
assert hass.states.get("hello.world") is not None
entry2 = registry.async_update_entity("hello.world", disabled_by="user")
entry2 = registry.async_update_entity(
"hello.world", disabled_by=entity_registry.DISABLED_USER
)
await hass.async_block_till_done()
assert entry2 != entry
assert ent.registry_entry == entry2