12 Commits

Author SHA1 Message Date
Tudor Sandu
d9b077154e
Blueprints for template entities (#126971)
* Template domain blueprints

* Default blueprint for templates

* Some linting

* Template entity updates

* Load and use blueprints in config

* Added missing mapping methods for templates

* Linting

* Added tests

* Wrong schema type

* Hassfest errors

* More linting issues

* Refactor based on desired schema

In the [architecture discussion](https://github.com/home-assistant/architecture/discussions/1027), the template blueprint instance did not specify the platform (e.g. `binary_sensor`), but the initial implementation assumed that schema.

* Create default template blueprints on first run

* Moved TemplateConfig definition

This is to avoid circular references

* Corrected methods to find templates based on blueprints

* Corrected missing entity config information

* Added tests

* Don't use hass.data

Address comments https://github.com/home-assistant/core/pull/126971/#discussion_r1780097187

* Prevent creating blueprints during testing

* Combine 2 ifs

Address comment https://github.com/home-assistant/core/pull/126971/#discussion_r1780160870

* Improve test coverage

* Prevent template component from dirtying test env

* Remove useless hard-coded validation

* Improve code coverage to 100%

* Address review comments

* Moved helpers in helpers.py

As per comment https://github.com/home-assistant/core/pull/126971#discussion_r1786539889

* Fix blueprint source URL

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-10-04 16:47:29 +02:00
epenet
5fb9537d6d
Use pytest.mark.usefixtures for start_ha in template tests (#126805) 2024-09-26 14:00:52 +02:00
epenet
166c588cac
Add LogCaptureFixture type hints in tests (#118372) 2024-05-29 14:10:00 +02:00
epenet
98d24dd276
Improve typing for calls fixture in tests (m-z) (#118350)
* Improve typing for `calls` fixture in tests (m-z)

* More

* More
2024-05-29 09:30:41 +02:00
Marc Mueller
32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Franck Nijhof
ef800335fb
Enable Ruff PT022 (#86792)
* Enable Ruff PT022

* Adjust found cases
2023-01-27 13:57:06 +01:00
Erik Montnemery
6cff2f8571
Tweak template light tests (#71729) 2022-05-13 12:22:34 +02:00
jan iversen
70eb519f76
Update template/test_light.py to use pytest (#56300) 2021-09-16 11:05:00 -07:00
jan iversen
6348bf70ac
Add caplog setup fixture. (#55714) 2021-09-04 07:09:55 -07:00
jan iversen
de7352dbde
Convert template/vacuum to pytest with fixtures (#54841) 2021-08-24 14:11:40 +02:00
Ville Skyttä
dc880118a4
Lint suppression cleanups (#47248)
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
Paulus Schoutsen
5dac3883b0
Stub light profiles (#42232) 2020-10-23 16:28:21 +02:00