mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-11-13 21:10:54 +00:00
Rename service-calls file to perform-actions to align terminology (#34254)
This commit is contained in:
@@ -19,7 +19,7 @@ This integration allows you to write Python scripts that are exposed as actions
|
||||
| `time` | The stdlib `time` available as limited access. |
|
||||
| `datetime` | The stdlib `datetime` available as limited access. |
|
||||
| `dt_util` | The ` homeassistant.util.dt` module. |
|
||||
| `output` | An empty dictionary. Add items to return data as [`response_variable`](/docs/scripts/service-calls#use-templates-to-handle-response-data). |
|
||||
| `output` | An empty dictionary. Add items to return data as [`response_variable`](/docs/scripts/perform-actions#use-templates-to-handle-response-data). |
|
||||
|
||||
Other imports like `min`, `max` are available as builtins. See the [python_script](https://github.com/home-assistant/core/blob/dev/homeassistant/components/python_script/__init__.py) source code for up-to-date information on the available objects inside the script.
|
||||
|
||||
@@ -137,7 +137,7 @@ current_forecast = hass.services.call("weather", "get_forecasts", service_data,
|
||||
|
||||
## Returning data
|
||||
|
||||
Python script itself can respond with data. Just add items to the `output` variable in your `python_script` and the whole dictionary will be returned. These can be used in automations to act upon the command results using [`response_variable`](/docs/scripts/service-calls#use-templates-to-handle-response-data).
|
||||
Python script itself can respond with data. Just add items to the `output` variable in your `python_script` and the whole dictionary will be returned. These can be used in automations to act upon the command results using [`response_variable`](/docs/scripts/perform-actions#use-templates-to-handle-response-data).
|
||||
|
||||
```python
|
||||
# hello_world.py
|
||||
|
||||
Reference in New Issue
Block a user