Commit Graph
180 Commits
Author SHA1 Message Date
Artur PragaczandGitHub e144804d28 Fix async_unload teardown race in scripts (#169562) 2026-05-05 15:03:37 +02:00
Erik MontnemeryandGitHub 4b28928702 Remove scripts from DATA_SCRIPTS on unload (#169415) 2026-04-29 18:09:49 +02:00
Erik MontnemeryandGitHub 3be1aa5441 Include errors in script trace when continue_on_error is set (#168676) 2026-04-29 17:30:47 +02:00
Erik MontnemeryandGitHub a92277b7fa Add method Script.unload (#169036) 2026-04-24 15:12:17 +02:00
epenetandGitHub a301a9c4b6 Always include homeassistant translations in tests (#162850) 2026-02-13 20:17:48 +01:00
epenetandGitHub 1c59d846e3 Cleanup unnecessary brackets for except statements (core) (#162410) 2026-02-06 13:45:59 +01:00
5cb5b0eb45 Handle wait_for_trigger service actions when extracting references (#161706)
Co-authored-by: Erik Montnemery <[email protected]>
2026-01-28 10:37:39 +00:00
Abílio CostaandGitHub 0ea03f549c Support target conditions in script relation extraction (#161338) 2026-01-21 12:01:15 +00:00
karwostsandGitHub 79339aefed Fix sequence block copy-paste (#155206) 2025-11-08 15:50:07 +01:00
karwostsandGitHub 03b15f1dba Log script condition warnings with the instance logger (#154966) 2025-10-24 18:42:17 +02:00
35f9cc55f1 Fix Automation/Script: sequence within a parallel ignoring enabled flag (#142977)
Co-authored-by: Abílio Costa <[email protected]>
Co-authored-by: Franck Nijhof <[email protected]>
2025-04-19 11:49:05 +02:00
alorenteandGitHub 63df2474a9 Fix missing response for queued mode scripts (#141460) 2025-03-28 10:47:41 +00:00
Artur PragaczandGitHub 798ee60ae5 Make variables action not restricted to local scopes (#141114)
Make variables action in scripts not restricted to local scopes
2025-03-23 14:07:52 +01:00
b964bc58be Fix variable scopes in scripts (#138883)
Co-authored-by: Erik <[email protected]>
2025-02-26 16:19:19 +01:00
epenetandGitHub 364556a7dd Prefer from...import...as over import...as in core tests (#136146) 2025-01-21 09:28:17 +01:00
Artur PragaczandGitHub b009f11013 Fix referenced objects in script sequences (#135499) 2025-01-13 11:40:53 +01:00
Petro31andGitHub 33222436d2 Nested stop actions will now return response_variables (#126393)
fix-nested-stop-variable-response
2024-11-27 09:18:02 +01:00
756a866ffd Add completed to the wait variable when using triggers (wait_for_trigger) (#123427)
* Add support for the wait.completed variable when using wait with triggers

* Remove junk comment

---------

Co-authored-by: Erik Montnemery <[email protected]>
2024-10-23 17:19:07 +02:00
Franck NijhofandGitHub 8b96c7873f Rename 'service' to 'action' in automations and scripts (#122845) 2024-07-31 14:36:53 +02:00
Franck NijhofandGitHub a9bf12f102 Rename Services to Actions in translation strings (#121777) 2024-07-15 21:19:25 +02:00
SidandGitHub 721b2c2ca8 Enable Ruff PT012 (#113957) 2024-06-08 17:59:08 +02:00
J. Nick KostonandGitHub 7bbb33b415 Improve script disallowed recursion logging (#118151) 2024-05-26 12:58:34 +02:00
9224997411 Add sequence action for automations & scripts (#117690)
Co-authored-by: Robert Resch <[email protected]>
2024-05-24 09:34:49 +02:00
Matthias AlphartandGitHub ec4c8ae228 Allow templates for enabling actions (#117049)
* Allow templates for enabling automation actions

* Use `cv.template` instead of `cv.template_complex`

* Rename test function
2024-05-15 21:03:52 +02:00
J. Nick KostonandGitHub 4529268544 Ensure scripts with timeouts of zero timeout immediately (#115830) 2024-04-19 18:24:54 +02:00
J. Nick KostonandGitHub ee535ee611 Ensure test async_create_task eager start behavior matches production (#115517) 2024-04-13 15:58:52 -05:00
J. Nick KostonandGitHub 569f54d8e3 Terminate scripts with until and while conditions that execute more than 10000 times (#115110) 2024-04-07 11:02:53 -10:00
SidandGitHub d5f883fbf0 Unignore Ruff PLR in tests (#114470)
* Unignore Ruff PLR in tests

* Address review comments

* review comments

* fix import

* Update test_api.py

* Update test_api.py

* Update test_api.py
2024-04-01 11:11:59 +02:00
J. Nick KostonandGitHub f4922edb4b Fix empty delays in script helper (#114346)
fixes
```
Logger: homeassistant.components.automation.kamermaster_knop_4_acties_licht
Bron: components/automation/__init__.py:726
integratie: Automatisering (documentatie, problemen)
Eerst voorgekomen: 22:17:29 (5 gebeurtenissen)
Laatst gelogd: 22:59:24

While executing automation automation.kamermaster_knop_4_acties_licht
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 726, in async_trigger
    return await self.action_script.async_run(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1645, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 454, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 506, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 536, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 504, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 626, in _async_delay_step
    if timeout_future.done():
       ^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'done'
```
2024-03-28 00:29:43 -04:00
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <[email protected]>
Co-authored-by: Marc Mueller <[email protected]>
Co-authored-by: J. Nick Koston <[email protected]>
2024-03-26 00:02:16 +01:00
Jan BouwhuisandGitHub 67ab49b825 Fetch ServiceNotFound message from translation cache and fix super (#114084)
* Fetch ServiceNotFound message from translation cache and fix super

* Fix tests trace component

* Fix script errors
2024-03-24 07:41:13 -10:00
Franck NijhofandGitHub 670bd97777 Find referenced labels in automations & scripts (#113812) 2024-03-19 16:28:37 +01:00
Franck NijhofandGitHub 38d0854b70 Find referenced floors in automations & scripts (#113802) 2024-03-19 14:18:53 +01:00
00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <[email protected]>
2024-03-19 09:01:07 +01:00
J. Nick KostonandGitHub bdede0e0da Start script runs eagerly (#113190) 2024-03-14 16:53:26 -10:00
J. Nick KostonandGitHub 324266a4e6 Fix race in script stop that could cause async_stop to hang forever (#113089) 2024-03-11 10:48:11 -10:00
Marc MuellerandGitHub a6b842f818 Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
J. Nick KostonandGitHub f6d4617c7a Avoid directly changing config entry state in tests (part 2) (#110115)
followup to #110048 for more places
2024-02-10 07:20:15 +01:00
Marc MuellerandGitHub cd0ee98dba Use builtin TimeoutError [core + helpers] (#109684) 2024-02-05 12:09:54 +01:00
Erik MontnemeryandGitHub 8abb4e5f52 Improve display of errors with no message in script trace (#108735) 2024-01-28 19:27:14 +01:00
Erik MontnemeryandGitHub 909e58066d Fix changed_variables in automation and script traces (#108788) 2024-01-24 19:12:45 +01:00
Erik MontnemeryandGitHub 431e4b38ac Improve tests of script trace (#108733) 2024-01-24 15:29:35 +01:00
069c2b7e38 Improve tests of script trace (#108717)
* Improve tests of script trace

* Update tests after rebase

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <[email protected]>

* Apply suggestions from code review

* Adjust

---------

Co-authored-by: Martin Hjelmare <[email protected]>
2024-01-23 19:53:09 +01:00
9bff039d17 Add set_conversation_response script action (#108233)
* Add set_conversation_response script action

* Update homeassistant/components/conversation/trigger.py

Co-authored-by: Martin Hjelmare <[email protected]>

* Revert accidental change

* Add test

* Ignore mypy

* Remove incorrect callback decorator

* Update homeassistant/helpers/script.py

* Add test with templated set_conversation_response

---------

Co-authored-by: Martin Hjelmare <[email protected]>
Co-authored-by: Paulus Schoutsen <[email protected]>
2024-01-23 09:13:42 -05:00
J. Nick KostonandGitHub c399cab427 Small speed up to checking core state (#107845) 2024-01-18 08:41:32 -10:00
Erik MontnemeryandGitHub 461dad3039 Fix changed_variables in automation traces (#106665) 2023-12-30 08:34:21 +01:00
Jan-Philipp BeneckeandGitHub d1aa690c24 Migrate non-component tests to use freezegun/freezer (#105142) 2023-12-07 22:58:09 +01:00
Franck NijhofandGitHub 70ad5ab3e4 Update helper tests to use device & entity registry fixtures (#103710) 2023-11-10 09:32:19 +01:00
Erik MontnemeryandGitHub b83ada8c19 Use real devices in automation and script tests (#102785) 2023-10-25 16:09:39 +02:00
Marc MuellerandGitHub c59404b5bc Fix additional test cases for Python 3.12 (#101006) 2023-09-27 17:19:20 +02:00