1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 22:18:40 +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

@@ -5,7 +5,7 @@ import pytest
from homeassistant.components.config import entity_registry
from homeassistant.const import ATTR_ICON
from homeassistant.helpers.entity_registry import RegistryEntry
from homeassistant.helpers.entity_registry import DISABLED_USER, RegistryEntry
from tests.common import (
MockConfigEntry,
@@ -200,14 +200,14 @@ async def test_update_entity(hass, client):
"id": 7,
"type": "config/entity_registry/update",
"entity_id": "test_domain.world",
"disabled_by": "user",
"disabled_by": DISABLED_USER,
}
)
msg = await client.receive_json()
assert hass.states.get("test_domain.world") is None
assert registry.entities["test_domain.world"].disabled_by == "user"
assert registry.entities["test_domain.world"].disabled_by == DISABLED_USER
# UPDATE DISABLED_BY TO NONE
await client.send_json(
@@ -305,7 +305,7 @@ async def test_enable_entity_disabled_device(hass, client, device_registry):
identifiers={("bridgeid", "0123")},
manufacturer="manufacturer",
model="model",
disabled_by="user",
disabled_by=DISABLED_USER,
)
mock_registry(