mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Rename 'service' to 'action' in automations and scripts (#122845)
This commit is contained in:
@@ -405,7 +405,7 @@ async def test_service_call(hass: HomeAssistant) -> None:
|
||||
"""Test service call with templating."""
|
||||
calls = async_mock_service(hass, "test_domain", "test_service")
|
||||
config = {
|
||||
"service": "{{ 'test_domain.test_service' }}",
|
||||
"action": "{{ 'test_domain.test_service' }}",
|
||||
"entity_id": "hello.world",
|
||||
"data": {
|
||||
"hello": "{{ 'goodbye' }}",
|
||||
@@ -435,7 +435,7 @@ async def test_service_call(hass: HomeAssistant) -> None:
|
||||
}
|
||||
|
||||
config = {
|
||||
"service": "{{ 'test_domain.test_service' }}",
|
||||
"action": "{{ 'test_domain.test_service' }}",
|
||||
"target": {
|
||||
"area_id": ["area-42", "{{ 'area-51' }}"],
|
||||
"device_id": ["abcdef", "{{ 'fedcba' }}"],
|
||||
@@ -455,7 +455,7 @@ async def test_service_call(hass: HomeAssistant) -> None:
|
||||
}
|
||||
|
||||
config = {
|
||||
"service": "{{ 'test_domain.test_service' }}",
|
||||
"action": "{{ 'test_domain.test_service' }}",
|
||||
"target": "{{ var_target }}",
|
||||
}
|
||||
|
||||
@@ -542,7 +542,7 @@ async def test_split_entity_string(hass: HomeAssistant) -> None:
|
||||
await service.async_call_from_config(
|
||||
hass,
|
||||
{
|
||||
"service": "test_domain.test_service",
|
||||
"action": "test_domain.test_service",
|
||||
"entity_id": "hello.world, sensor.beer",
|
||||
},
|
||||
)
|
||||
@@ -554,7 +554,7 @@ async def test_not_mutate_input(hass: HomeAssistant) -> None:
|
||||
"""Test for immutable input."""
|
||||
async_mock_service(hass, "test_domain", "test_service")
|
||||
config = {
|
||||
"service": "test_domain.test_service",
|
||||
"action": "test_domain.test_service",
|
||||
"entity_id": "hello.world, sensor.beer",
|
||||
"data": {"hello": 1},
|
||||
"data_template": {"nested": {"value": "{{ 1 + 1 }}"}},
|
||||
@@ -581,7 +581,7 @@ async def test_fail_silently_if_no_service(mock_log, hass: HomeAssistant) -> Non
|
||||
await service.async_call_from_config(hass, {})
|
||||
assert mock_log.call_count == 2
|
||||
|
||||
await service.async_call_from_config(hass, {"service": "invalid"})
|
||||
await service.async_call_from_config(hass, {"action": "invalid"})
|
||||
assert mock_log.call_count == 3
|
||||
|
||||
|
||||
@@ -597,7 +597,7 @@ async def test_service_call_entry_id(
|
||||
assert entry.entity_id == "hello.world"
|
||||
|
||||
config = {
|
||||
"service": "test_domain.test_service",
|
||||
"action": "test_domain.test_service",
|
||||
"target": {"entity_id": entry.id},
|
||||
}
|
||||
|
||||
@@ -613,7 +613,7 @@ async def test_service_call_all_none(hass: HomeAssistant, target) -> None:
|
||||
calls = async_mock_service(hass, "test_domain", "test_service")
|
||||
|
||||
config = {
|
||||
"service": "test_domain.test_service",
|
||||
"action": "test_domain.test_service",
|
||||
"target": {"entity_id": target},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user