Commit Graph

193 Commits (dev)

Author SHA1 Message Date
epenet 7c9b8552cb
Reapply "bump hassil and intents" (#132138) (#132151)
This reverts commit 39b2cf6ed2.
2024-12-03 15:21:41 +01:00
epenet 39b2cf6ed2
Revert "bump hassil and intents" (#132138)
* Revert "Fix bad hassil tests on CI (#132132)"

This reverts commit 101bb091ba.

* Revert "Bump hassil and intents (#132092)"

This reverts commit e52182940b.
2024-12-03 09:37:33 +01:00
Michael Hansen e52182940b
Bump hassil and intents (#132092) 2024-12-02 14:09:35 -05:00
Robert Resch 154282ff5c
Deprecate camera frontend_stream_type (#130932) 2024-11-22 13:42:33 +01:00
Abílio Costa 4776865584
Add unit translations for github integration (#130538)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-11-20 18:43:17 +01:00
Joost Lekkerkerker a1906b434f
Change trigger platform key to trigger (#124357)
* fix

* Fix

* Fix

* Update homeassistant/helpers/config_validation.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Fix

* Fix

* Fix

* Fix

* Add more tests

* Fix

* Fix tests

* Add tests

* Let's see what the CI does

* It fails on the code that tested the thing ofc

* It fails on the code that tested the thing ofc

* Revert test thingy

* Now the test works again, lovely

* Another one

* Fix websocket thingy

* Only copy when needed

* Improve comment

* Remove test

* Fix docstring

* I think this now also work since this transforms trigger to platform

* Add comment

* Update homeassistant/helpers/config_validation.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/helpers/config_validation.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/helpers/config_validation.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Check for mapping

* Add test

* Update homeassistant/helpers/config_validation.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update test to also test for trigger keys

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-09-25 14:19:58 +02:00
Franck Nijhof 9dfabc3fb7
Adjust automation to plural triggers/conditions/actions keys (#123823)
* Adjust automation to plural triggers/conditions/actions keys

* Fix some tests

* Adjust websocket tests

* Fix search tests

* Convert blueprint and blueprint inputs to modern schema

* Pass schema when creating Blueprint object

* Update tests

* Adjust websocket api

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
Co-authored-by: Erik <erik@montnemery.com>
2024-09-24 20:03:23 +02:00
epenet 904cf26d31
Add MockToggleEntity type hints in tests (#120075) 2024-06-21 12:32:03 +02:00
epenet d376371c25
Fix pylint warnings in testing config custom components (#119370) 2024-06-11 14:59:49 +02:00
Michael Hansen daee3d8db0
Don't prioritize "name" slot if it's a wildcard in default conversation agent (#117518)
* Don't prioritize "name" slot if it's a wildcard

* Fix typing error
2024-05-15 22:23:24 -04:00
J. Nick Koston 33412dd9f6
Remove unused legacy state translations (#112023)
* Remove unused state translations

There have been replaced with entity translations
https://github.com/home-assistant/developers.home-assistant/pull/1557
https://github.com/home-assistant/core/pull/82701

* nothing does merging anymore

* useless dispatch

* remove

* remove platform code from hassfest

* preen

* Update homeassistant/helpers/translation.py

* ruff

* fix merge

* check is impossible now since we already know if translations exist or not

* keep the function for now

* remove unreachable code since we filter out `.` before now

* reduce

* reduce

* fix merge conflict (again)
2024-04-14 07:13:17 -04:00
Sid 376aafc83e
Enable Ruff INP001 (#115082) 2024-04-08 15:43:58 +02:00
Sid aec7a67a58
Unignore Ruff PLE, PLW in tests (#114406)
* Unignore Ruff PLE, PLW in tests

* fix tests
2024-03-29 23:58:30 +01:00
Jan-Philipp Benecke 8d6d70d6b5
Use `setup_test_component_platform` helper for select entity component tests instead of `hass.components` (#114412)
* Use `setup_test_component_platform` helper for select entity component tests instead of `hass.components`

* Use _values instead of _attr_current_option

* Clean up

* Set default current_option for second mock entity

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-03-29 14:36:33 +01:00
Jan-Philipp Benecke 045dc3f1fb
Use `setup_test_component_platform` helper for datetime entity component tests instead of `hass.components` (#114415) 2024-03-29 07:51:10 +01:00
Jan-Philipp Benecke 74d614243b
Use `setup_test_component_platform` helper for date entity component tests instead of `hass.components` (#114413)
* Use `setup_test_component_platform` helper for date entity component tests instead of `hass.components`

* Remove missing
2024-03-29 07:43:19 +01:00
Jan-Philipp Benecke a102230498
Use `setup_test_component_platform` helper for time entity component tests instead of `hass.components` (#114411) 2024-03-29 07:34:00 +01:00
Jan-Philipp Benecke ae635a5586
Use `setup_test_component_platform` helper for fan entity component tests instead of `hass.components` (#114409) 2024-03-29 07:32:41 +01:00
Jan-Philipp Benecke 530552b4f5
Use `mock_platform` for device_tracker entity component tests instead of `hass.components` (#114398)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-03-28 15:23:21 -10:00
Jan-Philipp Benecke 3fd24989c6
Use `setup_test_component_platform` helper for text entity component tests instead of `hass.components` (#114400) 2024-03-28 21:08:25 +01:00
Jan-Philipp Benecke 71a0a7fe00
Use `setup_test_component_platform` helper for switch entity component tests instead of `hass.components` (#114305)
* Use `setup_test_component_platform` helper for switch entity component tests instead of `hass.components`

* Do not import fixtures

* Re-add switch.py to testing_config as stub

* Rename to mock_toggle_entities
2024-03-28 13:56:23 +01:00
Jan-Philipp Benecke 22b14d83e8
Use `setup_test_component_platform` helper for sensor entity component tests instead of `hass.components` (#114316)
* Use `setup_test_component_platform` helper for sensor entity component tests instead of `hass.components`

* Missing file

* Fix import

* Remove invalid device class
2024-03-28 12:07:55 +01:00
G Johansson 65230908c6
Remove deprecated forecast attribute from WeatherEntity (#110761)
* Remove deprecated forecast attribute from WeatherEntity

* Fix some

* Ruff

* ipma

* buienradar

* some more

* Some more

* More and more

* strings

* attr_forecast

* Fix nws

* Fix

* remove from coverage

* Remove recorder test

* Review comments
2024-03-27 16:51:29 +01:00
Jan-Philipp Benecke 5316b94705
Use `setup_test_component_platform` helper for alarm_control_panel entity component tests instead of `hass.components` (#114301) 2024-03-27 14:36:31 +01:00
Jan-Philipp Benecke 6313571fbc
Use `setup_test_component_platform` helper for binary_sensor entity component tests instead of `hass.components` (#114293) 2024-03-27 14:24:02 +01:00
Jan-Philipp Benecke 34cf0c5721
Use `setup_test_component_platform` func for cover entity component tests instead of `hass.components` (#114010)
* Use `mock_platform` for cover entity component tests instead of `hass.components`

* Remove setup fixture and use helper function

* Remove is_on from MockCover

* Run ruff

* Do not override state in `MockCover` in cover tests

* Remove is_on from MockCover
2024-03-27 12:20:19 +01:00
Jan-Philipp Benecke f94f1fb826
Use `setup_test_component_platform` func for number entity component tests instead of `hass.components` (#114017)
* Use `setup_test_component_platform` fixture for number entity component tests instead of `hass.components`

* Now function

* Ruff format
2024-03-26 21:56:38 +01:00
Jan-Philipp Benecke dce3bde0ab
Use `setup_test_component_platform` helper for update entity component tests instead of `hass.components` (#114203)
* Use `setup_test_component_platform` helper for update entity component tests instead of `hass.components`

* Run ruff format
2024-03-26 20:20:08 +01:00
Joost Lekkerkerker 6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller efc54971d3
Update empty line formatting after module docstring (#114040) 2024-03-23 00:27:57 +01:00
Jan-Philipp Benecke 25c4ab070b
Use `mock_platform` for event entity component tests instead of `hass.components` (#113667) 2024-03-17 17:32:16 +01:00
Jan-Philipp Benecke 73f11064d7
Use `mock_platform` for button entity component tests instead of `hass.components` (#113627) 2024-03-16 12:47:59 -10:00
Sid 0b9c9aff62
Add ruff rules PIE790, PIE794, PIE807, PIE810 (#113617) 2024-03-16 11:04:58 -10:00
Paulus Schoutsen 145657dc21
Only load services.yaml for integrations that have it (#112732)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-11 19:05:32 +01:00
J. Nick Koston afa69cca38
Import custom components in the executor by default (#112177)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-03-10 08:41:33 -10:00
J. Nick Koston 08416974c9
Avoid trying to load translations for integrations that have none (#112683) 2024-03-08 14:21:44 -10:00
Marc Mueller aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc Mueller a6b842f818
Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
Marc Mueller 19ab3d6daf
Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
Erik Montnemery 807c3ca76b
Add custom integration block list (#112481)
* Add custom integration block list

* Fix typo

* Add version condition

* Add block reason, simplify blocked versions, add tests

* Change logic for OK versions

* Add link to custom integration's issue tracker

* Add missing file

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-03-06 13:56:47 +01:00
J. Nick Koston 87739bc072
Add test to ensure bootstrap continues if an integraton raises CancelledError (#112472) 2024-03-05 19:34:16 -10:00
J. Nick Koston fbabbc8f92
Limit legacy state translations to custom components (#112295)
* Limit legacy state translations to custom components

We were trying to load **thousands** of `*.light.json`, `*.switch.json` files at run time that did not exist.

There have been replaced with entity translations: https://github.com/home-assistant/developers.home-assistant/pull/1557 https://github.com/home-assistant/core/pull/82701

https://github.com/home-assistant/core/pull/112023 will completely remove them, but
for now we will only load them for custom components to reduce the number
of files having to be examined

* reduce

* reduce

* reduce

* reduce

* comment

* coverage

* try to remove empty dict in loaded_translations fallback when missing
2024-03-05 17:27:45 -05:00
J. Nick Koston 5227976aa2
Group loading of platforms in the import executor (#112141)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-03-03 21:32:19 -10:00
J. Nick Koston c8cb0ff61d
Avoid trying to import platforms that do not exist (#112028)
* Avoid trying to import platforms that do not exist

* adjust

* fixes

* cleanup

* cleanup

* cleanup

* Apply suggestions from code review

* docs

* fixes

* fixes

* comment

* coverage

* coverage

* coverage

* Switch config to use async_get_component

This was another path where integrations that were marked to load in the executor
would be loaded in the loop

* Switch config to use async_get_component/async_get_platform

This was another path where integrations that were marked to load in the executor
would be loaded in the loop

* merge

* refactor

* refactor

* coverage

* preen

* preen
2024-03-02 22:14:28 -05:00
J. Nick Koston 6421a08ba8
Avoid expensive inspect calls in config validators (#112085)
* Avoid expensive inspect calls in config validators

inspect has a performance problem https://github.com/python/cpython/issues/92041

We now avoid calling inspect unless we are going to log

* remove unused

* reduce

* get_integration_logger
2024-03-02 21:50:35 -05:00
J. Nick Koston 4ea1c5cc3c
Add support for importing integrations in the executor (#111336)
* Add support for pre-imports at setup time

alternative solution to #111331

* refactor

* refactor

* refactor

* mark >1.0s integrations

* no point in executor if already loaded

* no point in executor if already loaded

* cleanup

* cleanup

* two more

* one more

* analytics loads a lot more integrations

* cloud

* debug

* psutil, hardwre

* try zha

* Update homeassistant/setup.py

* await

* comments

* coverage

* coverage

* coverage

* move logic to loader

* move logic to loader

* preserve comments
2024-02-26 14:49:43 -05:00
J. Nick Koston 9ce1ec414e
Reduce overhead to load multiple languages in translations (#111028)
* Reduce overhead to load multiple languages in translations

Instead of loading in a task, we now group everything
to be loaded into a single executor job

* fixes

* fixes

* fixes

* fixes

* fixes

* update tests

* add missing coverage (was existing)
2024-02-20 21:52:28 -05:00
Erik Montnemery 4229c35fcd
Improve color mode handling in MockLight (#109298) 2024-02-02 09:49:32 +01:00
Franck Nijhof 01372024f5
Add icon translations support (#103294)
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
2024-01-19 16:56:56 +01:00
Joakim Plate 523352c97e
Avoid keeping config dir in path (#107760) 2024-01-16 13:38:47 +01:00