Commit Graph

185 Commits (8cf1890772329799c19720410d045a0a18f6cc8a)

Author SHA1 Message Date
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
vexofp 3c53693fe3
Prevent toggle from calling stop on covers which do not support it (#106848)
* Prevent toggle from calling stop on covers which do not support it

* Update homeassistant/components/cover/__init__.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-01-09 12:32:27 +01:00
Erik Montnemery c805ea7b4f
Include deprecated constants in wildcard imports (#107114) 2024-01-05 11:46:45 +01:00
Michael eb01998395
Add support for placeholders in entity name translations (#104453)
* add placeholder support to entity name translation

* add negativ tests

* make property also available via description

* fix doc string in translation_placeholders()

* fix detection of placeholder

* validate placeholders for localized strings

* add test

* Cache translation_placeholders property

* Make translation_placeholders uncondotionally return dict

* Fall back to unsubstituted name in case of mismatch

* Only replace failing translations with English

* Update snapshots

* Blow up on non stable releases

* Fix test

* Update entity.py

---------

Co-authored-by: Erik <erik@montnemery.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-01-03 17:34:47 +01:00
Robert Resch fbcb31b103
Deprecate deprecated unit of measurement constants (#106455) 2023-12-27 09:04:25 +01:00
Robert Resch ea28b74fe9
Deprecate deprecated alarm control panel constants (#106058) 2023-12-20 18:41:17 +01:00
Robert Resch 491a50a2f1
Deprecate deprecated lock constants (#106113) 2023-12-20 18:07:17 +01:00
Robert Resch 9dd1b9e268
Deprecate deprecated device tracker constants (#106099) 2023-12-20 18:06:38 +01:00
Robert Resch 9830f77e9e
Deprecate deprecated cover constants (#106098) 2023-12-20 18:04:44 +01:00