Commit graph

263 commits

Author SHA1 Message Date
Erik Montnemery
c805ea7b4f
Include deprecated constants in wildcard imports () 2024-01-05 11:46:45 +01:00
Robert Resch
ea28b74fe9
Deprecate deprecated alarm control panel constants () 2023-12-20 18:41:17 +01:00
Robert Resch
db985925c4
Deprecate deprecated automation constants () 2023-12-19 19:22:13 +01:00
Erik Montnemery
5b55c7da5f
Remove logic converting empty or falsy YAML to empty dict ()
* Correct logic converting empty YAML to empty dict

* Modify according to github comments

* Add load_yaml_dict helper

* Update check_config script

* Update tests
2023-12-05 18:08:11 +01:00
Erik Montnemery
e5078a3e13
Use real devices in automation blueprint tests () 2023-10-25 23:20:50 -04:00
Erik Montnemery
b83ada8c19
Use real devices in automation and script tests () 2023-10-25 16:09:39 +02:00
Erik Montnemery
17ac1a6d32
Set automations which fail validation unavailable () 2023-06-27 18:23:33 +02:00
Erik Montnemery
a7d327afa2
Improve test coverage of automation extraction functions () 2023-06-19 23:05:20 +02:00
Jan Bouwhuis
ec98e22330
Add type hints for stub_blueprint_populate fixture ()
Add typehints for stub_blueprint_populate fixture
2023-05-26 08:13:13 +02:00
Erik Montnemery
3cca338c6e
Improve blueprint test fixtures () 2023-05-25 13:45:19 +02:00
Erik Montnemery
0126cfa9d9
Allow exposing any entity to the default conversation agent ()
* Allow exposing any entity to the default conversation agent

* Tweak

* Fix race, update tests

* Update tests
2023-05-03 09:45:54 -04:00
J. Nick Koston
d0d4ab6056
Require a list of entity ids when fetching history () 2023-04-08 16:14:44 -10:00
epenet
913156b0e0
Avoid lingering timer on script shutdown () 2023-03-16 08:00:21 +01:00
epenet
71dc98a39c
Improve hass_ws_client type hint in tests () 2023-03-14 16:31:40 +01:00
J. Nick Koston
1c57339ec3
Refactor recorder tests to use recorder history API () 2023-03-11 21:51:16 -05:00
Erik Montnemery
9989a4787b
Fix recorder platform tests () 2023-02-17 08:22:15 -06:00
Franck Nijhof
d3ed8de232
Update Ruff to v0.0.247 ()
* Update Ruff to v0.0.247

* Fix new found violations
2023-02-15 16:46:03 -05:00
Franck Nijhof
ed79265843
Enable Ruff PT006 ()
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet
0cf5e9fb4a
Add type hints to integration tests (part 2) ()
* Add type hints to integration tests (part 2)

* typo

* Improve analytics

* Improve automation

* Imrpove bluetooth
2023-02-10 16:05:26 +01:00
epenet
07a1a0efa9
Add type hints to integration tests (part 1) () 2023-02-09 16:09:13 +01:00
epenet
2545694d41
Add type hints to integration tests (a) ()
* Add type hints to accuweather tests

* Adjust a** components

* Adjust aiohttp_client

* ClientSessionGenerator/WebSocketGenerator
2023-02-08 12:16:23 +01:00
Franck Nijhof
c56832bb2c
Enable Ruff SIM300 () 2023-01-30 11:03:23 +01:00
Franck Nijhof
57cf11f067
Enable Ruff PT015 () 2023-01-27 11:10:29 +01:00
Franck Nijhof
24fdd588fd
Code styling tweaks to the tests - Part 1 () 2023-01-20 13:52:46 +01:00
Erik Montnemery
2c02abfdd4
Improve script config tests () 2022-12-22 12:16:23 +01:00
Erik Montnemery
a6217ca9b9
Improve error message when an automation fails to validate () 2022-12-21 23:20:50 +01:00
Joakim Plate
8bd4125390
Test corrections noticed during pytest upgrade ()
* Withing trigger a call to coordinator after init

* Stop discovery task on STOP event

* Stop dsmr connection task on STOP

* Use autospec in modem_serial tests

close on AioSerial is non async, and should not be mocked as a coroutine

* Make sure responder is specced correctly

tests/components/emulated_hue/test_init.py::test_setup_works
  /Users/joakim/src/hass/home-assistant/homeassistant/components/emulated_hue/__init__.py:119: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
    protocol.close()

* Don't assume Pymodbus is the only thing logging

* Use gather instead of wait

```
homeassistant/components/homeassistant/__init__.py:208: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
```

* Increase wait time for automation tests

Assuming exit within 1 seconds is unreasonable on a potentially loaded
test machine.

* Avoid changing app state after startup
2022-11-23 20:53:28 +01:00
Erik Montnemery
9bd676aff6
Improve automation reload ()
* Improve automation reload

* Small tweak

* Improve
2022-11-10 14:44:55 +01:00
Erik Montnemery
f7694c0550
Only reload modified scripts ()
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-10-24 20:47:06 +02:00
Erik Montnemery
31a787558f
Ensure recorder test fixture is setup before hass fixture ()
* Ensure recorder test fixture is setup before hass fixture

* Adjust more tests
2022-10-19 07:58:47 +02:00
Erik Montnemery
284893d942
Fix reload of automation and scripts when blueprint changed () 2022-10-14 16:43:09 +02:00
Erik Montnemery
81f40afd80
Only reload modified automations ()
* Only reload modified automations

* Update tests

* Adjust spelling

* Improve efficiency of matching automations and configurations

* Reload automations without an alias if they have been moved

* Add test

* Add test

* Add test
2022-10-14 15:28:03 +02:00
Paulus Schoutsen
4843d330f3
Allow fetching automation config () 2022-09-28 12:49:00 +02:00
Franck Nijhof
5f0cca9b26
Raise repairs issue if automation calls unknown service () 2022-08-25 20:56:26 -04:00
Erik Montnemery
1c1b23ef69
Correct referenced entities and devices for event triggers () 2022-08-15 17:35:30 -04:00
Erik Montnemery
5f2b4001f3
Separate recorder database schema from other classes ()
* Separate recorder database schema from other classes

* fix logbook imports

* migrate new tests

* few more

* last one

* fix merge

Co-authored-by: J. Nick Koston <nick@koston.org>
2022-06-07 14:41:43 +02:00
J. Nick Koston
24a0007785
Add additional context data to logbook events () 2022-05-12 17:21:14 -07:00
J. Nick Koston
24d7a464e1
Refactor logbook to reduce overhead and complexity () 2022-05-08 21:47:26 -07:00
Paulus Schoutsen
b1a04302b5
Stringify enums in selectors () 2022-05-06 11:25:01 -07:00
Erik Montnemery
1df99badcf
Allow scripts to turn themselves on () 2022-05-04 15:54:37 +02:00
Franck Nijhof
63679d3d29
Fix missing device & entity references in automations () 2022-05-01 21:49:50 -07:00
Erik Montnemery
28ebab9c5a
Simplify waiting for recorder in tests () 2022-04-25 12:04:47 +02:00
Erik Montnemery
982e314de6
Use recorder_mock in tests ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-04-22 19:29:44 -10:00
J. Nick Koston
c3108b3899
Exclude attributes for automation and script domains () 2022-04-18 12:10:18 +02:00
Franck Nijhof
8aff8d89d2
Clean up async_reproduce_state helper usage () 2022-03-24 14:40:54 +01:00
Erik Montnemery
46f27fdefd
Don't prevent automations from triggering themselves () 2022-03-15 18:48:54 +01:00
Chris Browet
e961d92b5e
Allow service data template to return a dict () 2021-10-23 21:10:30 +02:00
Richard T. Schaefer
9e219d9b6e
Add this variable for use by automation and script templates () 2021-07-28 09:09:13 +02:00
Erik Montnemery
b01b33c304
Add trigger condition ()
* Add trigger condition

* Tweaks, add tests
2021-06-11 15:05:57 +02:00
Erik Montnemery
2c8b7c56f5
Fix race when restarting script () 2021-04-16 09:03:34 +02:00