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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user