Update service tests

This commit is contained in:
abmantis 2025-07-23 14:43:12 +01:00
parent 50cb652b5f
commit 5d104d40e0

View File

@ -358,6 +358,13 @@ def label_mock(hass: HomeAssistant) -> None:
labels={"my-label"},
entity_category=EntityCategory.CONFIG,
)
diag_entity_with_my_label = RegistryEntryWithDefaults(
entity_id="light.diag_with_my_label",
unique_id="diag_with_my_label",
platform="test",
labels={"my-label"},
entity_category=EntityCategory.DIAGNOSTIC,
)
entity_with_label1_from_device = RegistryEntryWithDefaults(
entity_id="light.with_label1_from_device",
unique_id="with_label1_from_device",
@ -395,6 +402,7 @@ def label_mock(hass: HomeAssistant) -> None:
hass,
{
config_entity_with_my_label.entity_id: config_entity_with_my_label,
diag_entity_with_my_label.entity_id: diag_entity_with_my_label,
entity_with_label1_and_label2_from_device.entity_id: entity_with_label1_and_label2_from_device,
entity_with_label1_from_device.entity_id: entity_with_label1_from_device,
entity_with_label1_from_device_and_different_area.entity_id: entity_with_label1_from_device_and_different_area,
@ -778,6 +786,8 @@ async def test_extract_entity_ids_from_labels(hass: HomeAssistant) -> None:
assert {
"light.with_my_label",
"light.config_with_my_label",
"light.diag_with_my_label",
} == await service.async_extract_entity_ids(hass, call)
call = ServiceCall(hass, "light", "turn_on", {"label_id": "label1"})