Erik Montnemery
09ba46ddb9
Mask sensitive data in google_assistant logs ( #109366 )
...
* Mask sensitive data in google_assistant logs
* Move common code to homeassistant/util/redact.py
* Move to helpers
* Add tests
* Tweak
* Redact additional logs
* Fix stale docstring
* Don't reveal the length of masked data
* Update test
2024-02-02 22:10:30 +01:00
J. Nick Koston
ed726db974
Fix race in loading service descriptions ( #109316 )
2024-02-01 12:34:23 -06:00
Bram Kragten
d361d47516
Add qr code selector ( #109214 )
2024-01-31 19:27:03 +01:00
Martijn van der Pol
b386960661
Add default parameter to as_datetime template function/filter ( #107229 )
...
* improve as_datetime
* Improve `as_datetime` Jinja filter/function
* review
* resolve more review items
* change test for datetime input
* Update docstring
* update docstrings for tests
* remove whitespace
* only_default
* Update do string and comment
* improve comment
* Adjust comment
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-01-29 18:05:44 +01:00
Erik Montnemery
8abb4e5f52
Improve display of errors with no message in script trace ( #108735 )
2024-01-28 19:27:14 +01:00
karwosts
a2d707442a
Fix error when passing a whole number to location selector ( #108952 )
...
* Fix error when passing an integer to location selector
* fix tests
* more fix tests
* don't mutate original dict
* remove string testcase
2024-01-28 14:13:00 +01:00
Erik Montnemery
909e58066d
Fix changed_variables in automation and script traces ( #108788 )
2024-01-24 19:12:45 +01:00
Erik Montnemery
9c727e5ea8
Add icon to areas ( #108650 )
2024-01-24 19:11:03 +01:00
Erik Montnemery
431e4b38ac
Improve tests of script trace ( #108733 )
2024-01-24 15:29:35 +01:00
Daniel
a67113a95a
Parse template result in async_render_with_possible_json_value ( #99670 )
...
* Optionally parse templates rendered with possible json
* Remove duplicate strip
* Add tests for parsing template result
2024-01-24 12:12:28 +01:00
Erik Montnemery
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 <marhje52@gmail.com>
* Apply suggestions from code review
* Adjust
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-01-23 19:53:09 +01:00
Erik Montnemery
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 <marhje52@gmail.com>
* 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 <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-01-23 09:13:42 -05: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
J. Nick Koston
c399cab427
Small speed up to checking core state ( #107845 )
2024-01-18 08:41:32 -10:00
J. Nick Koston
454c62b5b4
Avoid total_seconds conversion every state write when context is set ( #107617 )
2024-01-13 21:04:32 -05:00
J. Nick Koston
4b7a313ece
Use identity checks for CoreState ( #107846 )
...
Some of the checks used ==, and some used is. Switch
everything to is as its faster
2024-01-12 10:21:26 +01:00
Erik Montnemery
8a9f9b94ef
Fix call to async_setup_component in translation test ( #107807 )
2024-01-11 10:09:32 -10:00
Lars R
bf6b9175a1
Add 'bitwise_xor' filter to jinja templates ( #104942 )
...
Co-authored-by: Robert Resch <robert@resch.dev>
2024-01-10 09:40:52 +01:00
Erik Montnemery
9859306718
Prevent overriding cached attribute as property ( #107657 )
...
* Prevent overriding cached attribute as property
* Remove debug
2024-01-09 19:16:45 +01:00
Marc Mueller
fde7a6e9ef
Improve dispatcher typing ( #106872 )
2024-01-08 09:45:37 +01:00
J. Nick Koston
d260ed938a
Reduce overhead to call entity services ( #106908 )
2024-01-08 09:30:52 +01:00
J. Nick Koston
d04e2d56da
Add support for JSON fragments ( #107213 )
2024-01-07 17:36:31 -10:00
Erik Montnemery
c805ea7b4f
Include deprecated constants in wildcard imports ( #107114 )
2024-01-05 11:46:45 +01:00
Michael Hansen
269500cb29
Report missing entities/areas instead of failing to match in Assist ( #107151 )
...
* Report missing entities/areas instead of failing
* Fix test
* Update assist pipeline test snapshots
* Test complete match failure
* Fix conflict
2024-01-04 17:09:20 -06:00
J. Nick Koston
0695bf8988
Move group helpers into their own module ( #106924 )
...
This gets rid of the legacy need to use bind_hass, and
the expand function no longer looses typing.
2024-01-04 17:34:56 +01:00
Erik Montnemery
9eefd95e91
Deduplicate handling of duplicated constants ( #107074 )
...
* Deduplicate handling of duplicated constants
* Use DeprecatedConstant + DeprecatedConstantEnum
* Fixup
* Remove test cases with unnamed tuples
2024-01-04 13:25:09 +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
J. Nick Koston
09b65f14b9
Index entities by domain for entity services ( #106759 )
2024-01-02 15:28:58 +01:00
Erik Montnemery
599271fdc0
Don't use entity_id in __repr__ of not added entity ( #106861 )
2024-01-02 11:35:16 +01:00
Erik Montnemery
c1f1b5c50b
Ensure it's safe to call Entity.__repr__ on non added entity ( #106032 )
2023-12-31 18:54:34 +01:00
Erik Montnemery
461dad3039
Fix changed_variables in automation traces ( #106665 )
2023-12-30 08:34:21 +01:00
Erik Montnemery
56a58f9285
Improve tests of inheriting entity descriptions ( #106647 )
2023-12-29 13:22:52 +01:00
J. Nick Koston
a46fe94216
Add helper to report deprecated entity supported features magic numbers ( #106602 )
2023-12-28 12:24:36 -10:00
Martijn van der Pol
a823edf1c2
Jinja filter and function for `median` and `statistical_mode` ( #105554 )
...
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-12-27 15:14:20 +01:00
Robert Resch
fbcb31b103
Deprecate deprecated unit of measurement constants ( #106455 )
2023-12-27 09:04:25 +01:00
Marc Mueller
c6d1f1ccc8
Fix pytest test collection warning ( #106405 )
2023-12-26 16:23:19 +01:00
Robert Resch
ebdf7b9c8c
Deprecate some deprecated const constants ( #106230 )
...
* Deprecate some deprecated const constants
* Improve code
* fix typing
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-12-23 20:18:51 +01:00
Erik Montnemery
3a744d374b
Add support for caching entity properties ( #100601 )
2023-12-22 09:02:55 -10:00
Robert Resch
e18d2b8873
Deprecate deprecated device_registry helper constants ( #106227 )
2023-12-22 11:21:45 +01:00
Robert Resch
c4c422de79
Skip logging deprecated constant if the calling integration couldn't be indentified ( #106181 )
...
* Add option to log only if a integreation is detected for a deprecated constant
* Require param
* Add test that log entry is not created
* typo
2023-12-21 23:19:40 +01:00
Erik Montnemery
0534b0dee4
Improve entity tests ( #106175 )
2023-12-21 15:32:25 +01:00
Ville Skyttä
24b1e01d71
Update Ruff to 0.1.8, avoid linter/formatter conflicts ( #106080 )
...
* Disable Ruff rules that may conflict with the formatter
* Upgrade Ruff to 0.1.8
- https://github.com/astral-sh/ruff/releases/tag/v0.1.7
- https://github.com/astral-sh/ruff/releases/tag/v0.1.8
* Format with Ruff 0.1.8
2023-12-20 23:55:09 +01:00
Robert Resch
5a3db078d5
Use patch.dict in deprecation test "test_check_if_deprecated_constant" ( #106117 )
2023-12-20 16:06:26 +01:00
Robert Resch
0e0fd39603
Add dir_with_deprecated_constants function to deprecation helper ( #106059 )
2023-12-19 16:37:21 +01:00
Robert Resch
a4ccd6e13b
Deprecate binary sensor device class constants ( #105736 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-12-19 12:45:32 +01:00
Michael
29e30e796a
Add significant change helper check_valid_float ( #106005 )
2023-12-18 21:59:30 +01:00
Erik Montnemery
2515e520c1
Allow step size any for number selector in slider mode ( #105978 )
2023-12-18 15:30:59 +01:00
J. Nick Koston
47f8e08261
Reduce overhead to connect dispatcher ( #105715 )
...
Reduce overhead connect dispatcher
- We tend to have 1000s (or 10000s) of connected dispatchers which
makes these prime targets to reduce overhead/memory
- Instead of creating new functions to wrap log exceptions each time
use partials which reuses the function body and only create new
arguments
Previous optimizations #103307 #93602
2023-12-16 10:16:58 +01:00
Erik Montnemery
9020dbb093
Remove context_recent_time property from entity base class ( #105652 )
2023-12-14 08:33:31 +01:00
Erik Montnemery
dd5a48996a
Keep capabilities up to date in the entity registry ( #101748 )
...
* Keep capabilities up to date in the entity registry
* Warn if entities update their capabilities very often
* Fix updating of device class
* Stop tracking capability updates once flooding is logged
* Only sync registry if state changed
* Improve test
* Revert "Only sync registry if state changed"
This reverts commit 1c52571596c06444df234d4b088242b494b630f2.
* Avoid calculating device class twice
* Address review comments
* Revert using dataclass
* Fix unintended revert
* Add helper method
2023-12-13 17:27:26 +01:00
Erik Montnemery
22c3847c0e
Allow inheriting `FrozenOrThawed` with custom init ( #105624 )
2023-12-13 10:13:34 +01:00
Erik Montnemery
5bd0833f49
Improve FrozenOrThawed ( #105541 )
2023-12-12 21:19:41 +01:00
Erik Montnemery
dd338799d4
Make it possible to inherit EntityDescription in frozen and mutable dataclasses ( #105211 )
2023-12-11 20:00:55 +01:00
Jan Bouwhuis
4bb0e13cda
Workaround `to_json` template filter in parsing dict key ( #105327 )
...
* Work-a-round orjson for `to_json` fiter in case dict key is str subclass
* Add option instead
* Remove json.dumps work-a-round
* Update homeassistant/helpers/template.py
* Fix test
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-12-08 20:57:53 +01:00
Jan-Philipp Benecke
d1aa690c24
Migrate non-component tests to use freezegun/freezer ( #105142 )
2023-12-07 22:58:09 +01:00
Erik Montnemery
3bcc6194ef
Add domain key config validation ( #104242 )
...
* Drop use of regex in helpers.extract_domain_configs
* Update test
* Revert test update
* Add domain_from_config_key helper
* Add validator
* Address review comment
* Update snapshots
* Inline domain_from_config_key in validator
2023-12-05 15:07:32 +01:00
Erik Montnemery
25bea91683
Use modern platform path when reporting platform config errors ( #104238 )
...
* Use modern platform path when reporting platform config errors
* Update tests
* Address review comment
* Explicitly pass platform domain to log helpers
* Revert overly complicated changes
* Try a simpler solution
2023-12-05 15:06:13 +01:00
Erik Montnemery
84e74e4c74
Reverse component path ( #104087 )
...
* Reverse component path
* Update translations helper
* Fix
* Revert incorrect change of PLATFORM_FORMAT
* Fix use of PLATFORM_FORMAT in tts
* Fix ios
2023-12-05 08:43:58 +01:00
Erik Montnemery
35e2f591c1
Make `cv.string` return subclasses of str as is ( #103916 )
2023-12-04 20:36:16 +01:00
Erik Montnemery
95f7db1970
Move config_per_platform and extract_domain_configs to config.py ( #104989 )
2023-12-04 12:48:49 +01:00
Erik Montnemery
db51a8e1f7
Allow passing breaks_in_ha_version to deprecation helper decorators ( #104985 )
2023-12-04 11:52:10 +01:00
J. Nick Koston
1522118453
Remove aiohttp cancel on disconnect workaround ( #104175 )
2023-11-29 11:20:36 -07:00
Paul Bottein
38eda9f46e
Add multiple option to text selector ( #104635 )
...
Co-authored-by: Robert Resch <robert@resch.dev>
2023-11-29 18:32:32 +01:00
schelv
31cab5803c
Add Option For Kelvin Unit To Color Temperature Selector ( #103799 )
2023-11-29 12:25:06 +01:00
Aarni Koskela
706add4a57
Switch formatting from black to ruff-format ( #102893 )
...
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-11-27 14:38:59 +01:00
Jan Bouwhuis
af71c2bb45
Raise and suppress stack trace when reloading yaml fails ( #102410 )
...
* Allow async_integration_yaml_config to raise
* Docstr - split check
* Implement as wrapper, return dataclass
* Fix setup error handling
* Fix reload test mock
* Move log_messages to error handler
* Remove unreachable code
* Remove config test helper
* Refactor and ensure notifications during setup
* Remove redundat error, adjust tests notifications
* Fix patch
* Apply suggestions from code review
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Follow up comments
* Add call_back decorator
* Split long lines
* Update exception abbreviations
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-11-24 17:34:45 +01:00
Erik Montnemery
a573f60947
Rename some check_config test cases ( #104244 )
2023-11-20 13:02:44 +01:00
Erik Montnemery
80813e992d
Improve formatting of component errors ( #104081 )
...
* Improve formatting of component errors
* Update tests
2023-11-17 23:01:00 +01:00
Erik Montnemery
a78764f000
Improve formatting of package errors ( #104078 )
2023-11-17 14:57:37 +01:00
Erik Montnemery
4536fb3541
Remove mock_entity_platform test helper ( #104073 )
2023-11-16 16:55:08 +01:00
Erik Montnemery
b400b33b0d
Refer to domain configuration in custom validator errors ( #104065 )
2023-11-16 15:28:48 +01:00
Erik Montnemery
d8a49b14e5
Use relative paths in configuration validation error messages ( #104064 )
2023-11-16 10:56:47 +01:00
Erik Montnemery
98030a9ce1
Improve formatting of package errors ( #103976 )
2023-11-16 09:08:47 +01:00
Erik Montnemery
1c817cc18c
Attach relevant config to check_config errors ( #104048 )
2023-11-16 07:25:52 +01:00
Erik Montnemery
5b37096b5f
Refactor config.async_log_exception ( #104034 )
...
* Refactor config.async_log_exception
* Improve test coverage
* Make functions public
2023-11-15 19:09:49 +01:00
Erik Montnemery
dd7670cacf
Improve errors for component configuration with missing keys ( #103982 )
2023-11-15 10:47:05 +01:00
Erik Montnemery
94a2087ba0
Improve formatting of config validation errors ( #103957 )
...
* Improve formatting of config validation errors
* Address review comments
2023-11-14 12:48:45 +01:00
Erik Montnemery
dedd3418a1
Improve print of line numbers when there are configuration errors ( #103216 )
...
* Improve print of line numbers when there are configuration errors
* Update alarm_control_panel test
2023-11-14 08:21:36 +01:00
Erik Montnemery
07af073735
Remove trailing space from configuration error messages ( #103909 )
...
* Remove trailing space from configuration error messages
* Update test
2023-11-13 15:19:37 +01:00
Erik Montnemery
01b3e0c49e
Remove useless code from entity helper tests ( #103854 )
2023-11-12 18:55:34 +01:00
Allen Porter
787fb3b954
Improve OAuth error handling in configuration flows ( #103157 )
...
* Improve OAuth error handling in configuration flows
* Update strings for all integrations that use oauth2 config flow
* Remove invalid_auth strings
* Revert change to release
* Revert close change in aiohttp mock
2023-11-11 11:02:51 +01:00
Franck Nijhof
70ad5ab3e4
Update helper tests to use device & entity registry fixtures ( #103710 )
2023-11-10 09:32:19 +01:00
Erik Montnemery
123f14dd6c
Attach correct platform config in check_config warnings and errors ( #103633 )
2023-11-09 00:06:04 +01:00
Erik Montnemery
d913508607
Allow removing an entity more than once ( #102904 )
2023-11-08 12:50:40 +01:00
Erik Montnemery
cc5eda76d3
Humanize core config errors in check_config helper ( #103635 )
2023-11-08 10:15:27 +01:00
Erik Montnemery
3ba8a82243
Differentiate between warnings and errors in check_config helper ( #102902 )
...
* Differentiate between warnings and errors in check_config helper
* Update tests
* Treat configuration errors in frontend and its dependencies as errors
* Improve test coverage
* Address review comments
* Improve test coverage
* Improve test coverage
* Address review comments
* Add comment
2023-11-05 03:08:04 +01:00
Jan-Philipp Benecke
ae1117bc74
Fix failing entity reuse test ( #103342 )
...
* Fix failing entity reuse test
* One more test
2023-11-03 23:19:37 +01:00
Erik Montnemery
0ea0a1ed06
Prevent accidentally reusing an entity object ( #102911 )
...
* Prevent accidentally reusing an entity object
* Fix group reload service
* Revert "Fix group reload service"
* Improve test
* Add tests aserting entity can't be reused
2023-11-03 21:01:38 +01:00
Paul Bottein
89a9e6c6e8
Add trigger selector for blueprint ( #103050 )
2023-11-03 09:11:49 +01:00
Kevin Stillhammer
06c9719cd6
Support multiple responses for service calls ( #96370 )
...
* add supports_response to platform entity services
* support multiple entities in entity_service_call
* support legacy response format for service calls
* revert changes to script/shell_command
* add back test for multiple responses for legacy service
* remove SupportsResponse.ONLY_LEGACY
* Apply suggestion
Co-authored-by: Allen Porter <allen.porter@gmail.com>
* test for entity_id remove None
* revert Apply suggestion
* return EntityServiceResponse from _handle_entity_call
* Use asyncio.gather
* EntityServiceResponse not Optional
* styling
---------
Co-authored-by: Allen Porter <allen.porter@gmail.com>
2023-11-02 18:37:35 -07:00
Erik Montnemery
03d3a87f23
Small cleanup of legacy groups ( #102918 )
...
* Small cleanup of legacy groups
* Update tests which create groups
2023-10-28 17:16:41 +02:00
Erik Montnemery
6f515c06a2
Add test for check_config helper ( #102898 )
2023-10-28 14:52:20 +02:00
Erik Montnemery
294f565bad
Allow missing components in safe mode ( #102888 )
2023-10-27 12:25:27 +02:00
Erik Montnemery
b83ada8c19
Use real devices in automation and script tests ( #102785 )
2023-10-25 16:09:39 +02:00
Raman Gupta
35d18a9a3e
Add tests for types and functions for type conversions in templates ( #100807 )
...
Co-authored-by: Robert Resch <robert@resch.dev>
2023-10-25 13:20:34 +02:00
J. Nick Koston
f91583a0fc
Add support for family to aiohttp session helper ( #102702 )
2023-10-24 18:40:39 -05:00
Erik Montnemery
c481fdb7d0
Rename safe mode to recovery mode ( #102580 )
2023-10-23 20:33:08 +02:00
Erik Montnemery
1621310ba7
Add serial_number to device registry entries ( #102334 )
...
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-10-22 15:14:44 +02:00
J. Nick Koston
433c022687
Save previous unique id in entity registry when it changes ( #102093 )
2023-10-16 21:26:19 -10:00
J. Nick Koston
e5ebdf7ad4
Remove implict name check from Entity base class ( #101905 )
2023-10-15 23:40:43 +02:00
G Johansson
dc29190564
CountrySelector ( #100963 )
...
* CountrySelector
* rename
* remove multiple for now
* Add no_sort
* Update homeassistant/helpers/selector.py
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-10-12 16:44:30 +02:00
Robert Resch
b932c67eb7
Delete optional schema keys, when they are not present ( #101755 )
...
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-10-10 21:08:54 +02:00
Nicolas van de Walle
1b11062b27
Improved debugging for "Failed to set state" ( #101657 )
2023-10-08 19:40:42 +02:00
Joost Lekkerkerker
faea3b1634
Abort config flow when invalid token is received ( #101642 )
2023-10-08 13:32:35 +02:00
Erik Montnemery
20188181f7
Fix spelling in sensor test ( #101520 )
2023-10-06 11:51:08 +02:00
Erik Montnemery
3478666973
Use loader.async_suggest_report_issue in deprecation helper ( #101393 )
2023-10-06 09:51:08 +02:00
Erik Montnemery
dce5099d92
Use loader.async_suggest_report_issue in frame helper ( #101461 )
2023-10-05 19:52:26 +02:00
Erik Montnemery
7e39acda37
Minor improvement of frame helper ( #101387 )
...
* Minor improvement of frame helper
* Add new custom integration for testing
* Make IntegrationFrame kw_only
2023-10-04 21:43:00 +02:00
Erik Montnemery
17779c5f0c
Add loader.async_suggest_report_issue and loader.async_get_issue_tracker ( #101336 )
...
* Add loader.async_suggest_report_issue and loader.async_get_issue_tracker
* Update tests
* Add tests
* Address review comments
* Address review comments
2023-10-04 13:40:33 +02:00
Erik Montnemery
2627abb9ef
Improve test coverage of deprecation helper ( #101335 )
2023-10-03 20:57:24 +02:00
Erik Montnemery
ab2de18f8f
Refactor frame.get_integration_frame ( #101322 )
2023-10-03 19:21:27 +02:00
Marc Mueller
100b6fd06f
Fix flaky lru_cache test ( #101252 )
2023-10-02 13:52:56 +02:00
Ville Skyttä
f4bf8fa8f1
Catch HTML case insensitively in "no HTML" config validation ( #101181 )
2023-10-01 16:19:24 +02:00
Erik Montnemery
47ecce4873
Allow deleting entity entries from entity_registry.async_migrate_entries ( #101094 )
...
* Allow deleting entity entries from entity_registry.async_migrate_entries
* Explicitly return None in tests
2023-09-30 10:23:10 +02:00
Marc Mueller
c59404b5bc
Fix additional test cases for Python 3.12 ( #101006 )
2023-09-27 17:19:20 +02:00
Erik Montnemery
ab060b86d1
Remove async_process_integration_platform_for_component ( #100680 )
2023-09-21 17:06:41 +02:00
Erik Montnemery
d1afcd773f
Revert "Cache entity properties that are never expected to change in the base class" ( #100422 )
...
Revert "Cache entity properties that are never expected to change in the base class (#95315 )"
This reverts commit 042776ebb8
.
2023-09-15 11:25:24 +02:00
J. Nick Koston
042776ebb8
Cache entity properties that are never expected to change in the base class ( #95315 )
2023-09-14 17:48:48 -05:00
Erik Montnemery
bbcbb2e322
Improve Entity._suggest_report_issue ( #100204 )
2023-09-12 21:07:32 +02:00
Erik Montnemery
51576b7214
Improve typing of entity.entity_sources ( #99407 )
...
* Improve typing of entity.entity_sources
* Calculate entity info source when generating WS response
* Adjust typing
* Update tests
2023-09-12 20:41:26 +02:00
Erik Montnemery
1654ef7759
Make WS command render_template not give up if initial render raises ( #99808 )
2023-09-08 21:02:06 +02:00
J. Nick Koston
034fabe188
Use loop time to set context ( #99701 )
...
* Use loop time to set context
loop time is faster than utcnow, and since its only used internally it can
be switched without a breaking change
* fix mocking
2023-09-06 11:04:49 +02:00
Erik Montnemery
48f7924e9e
Allow specifying a custom log function for template render ( #99572 )
...
* Allow specifying a custom log function for template render
* Bypass template cache when reporting errors + fix tests
* Send errors as events
* Fix logic for creating new TemplateEnvironment
* Add strict mode back
* Only send error events if report_errors is True
* Force test of websocket_api only
* Debug test
* Run pytest with higher verbosity
* Timeout after 1 minute, enable syslog output
* Adjust timeout
* Add debug logs
* Fix unsafe call to WebSocketHandler._send_message
* Remove debug code
* Improve test coverage
* Revert accidental change
* Include severity in error events
* Remove redundant information from error events
2023-09-06 10:03:35 +02:00
J. Nick Koston
a2dae60170
Refactor dispatcher to reduce run time and memory overhead ( #99676 )
...
* Fix memory leak in dispatcher removal
When we removed the last job/callable from the dict for the
signal we did not remove the dict for the signal which meant
it leaked
* comment
* cleanup a bit more
2023-09-05 21:18:27 -04:00
Erik Montnemery
709ce7e0af
Set state of entity with invalid state to unknown ( #99452 )
...
* Set state of entity with invalid state to unknown
* Add test
* Apply suggestions from code review
Co-authored-by: Robert Resch <robert@resch.dev>
* Update test_entity.py
---------
Co-authored-by: Robert Resch <robert@resch.dev>
2023-09-04 14:09:51 +02:00
Erik Montnemery
9dac6a2948
Use loop.time in DataUpdateCoordinator ( #98937 )
2023-08-28 10:16:34 -05:00
Ville Skyttä
6399d74c15
Remove unnnecessary pylint configs from core ( #98704 )
2023-08-22 23:12:12 +02:00
Ville Skyttä
3094991236
Upgrade ruff to 0.0.285 ( #98647 )
2023-08-19 08:17:17 -04:00
Erik Montnemery
7fcc2dd44e
Make the check_config script open issue_registry read only ( #98545 )
...
* Don't blow up if validators can't access the issue registry
* Make the check_config script open issue_registry read only
* Update tests/helpers/test_issue_registry.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-08-18 20:15:00 +02:00
Marc Mueller
a9ade1f84d
Use asyncio.timeout [core] ( #98447 )
2023-08-15 08:36:05 -05:00
Erik Montnemery
97f3199d6d
Do not add entities with invalid device info ( #98150 )
2023-08-11 13:14:47 +02:00
Franck Nijhof
296c27859e
Fix issue registry sending unneeded update events ( #98230 )
2023-08-10 21:57:42 -04:00
Erik Montnemery
4e8b81370e
Adjust device_registry tests which create devices ( #98215 )
2023-08-10 19:28:33 +02:00
Erik Montnemery
c7b4d4f361
Adjust helpers tests which create devices ( #98214 )
2023-08-10 19:28:16 +02:00
Marc Mueller
f39a35c4ef
Fix jinja2 DeprecationWarnings ( #97728 )
2023-08-04 11:25:08 +02:00
Paul Bottein
83af2f5b8b
Allow to sort options in select selector ( #97680 )
...
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-08-03 21:49:22 +02:00
Meow
6fd60024cc
Refactored deprecated UNITS ( #97368 )
2023-08-03 21:12:01 +02:00
Franck Nijhof
af5fc7e759
Ensure load the device registry if it contains invalid configuration URLs ( #97589 )
2023-08-01 23:15:31 +02:00
J. Nick Koston
094f2cbad7
Fix saving subclassed datetime objects in storage ( #97502 )
2023-07-31 18:49:02 +02:00
J. Nick Koston
13349e76ed
Avoid firing update coordinator callbacks when nothing has changed ( #97268 )
2023-07-28 12:19:20 -05:00
Franck Nijhof
737ac8c600
Fix DeviceInfo configuration_url validation ( #97319 )
2023-07-27 18:57:01 +02:00
Franck Nijhof
b655b9d530
Allow for translating service examples ( #97141 )
2023-07-24 15:57:02 +02:00
Marc Mueller
995c29e052
Cleanup EventType typing ( #97136 )
2023-07-24 13:18:38 +02:00
Marc Mueller
4161f53bea
Improve `async_track_state_change_filtered` callback typing ( #97134 )
2023-07-24 12:42:29 +02:00
Marc Mueller
582499a260
Improve `async_track_template_result` callback typing ( #97135 )
2023-07-24 12:42:17 +02:00
Marc Mueller
797a9c1ead
Improve `async_track_state_added/removed_domain` callback typing ( #97126 )
2023-07-24 09:11:41 +02:00
Marc Mueller
2618bfc073
Use EventType for state changed [core] ( #97115 )
2023-07-23 18:10:03 -05:00
Jan Bouwhuis
9424d11408
Allow homeassistant in MQTT configuration_url schema ( #96107 )
2023-07-22 22:50:58 +02:00
Erik Montnemery
df46179d26
Fix broken service test ( #96943 )
2023-07-20 13:11:55 +02:00
Joost Lekkerkerker
0ba2531ca4
Fix bug in check_config when an integration is removed by its own validator ( #96068 )
...
* Raise if present is False
* Fix feedback
* Update homeassistant/helpers/check_config.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Update homeassistant/helpers/check_config.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Fix tests
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-07-20 11:45:44 +02:00
J. Nick Koston
01e66d6fb2
Improve handling of unrecoverable storage corruption ( #96712 )
...
* Improve handling of unrecoverable storage corruption
fixes #96574
If something in storage gets corrupted core can boot loop
or if its integration specific, the integration will fail to
start.
We now complainly loudly in the log, move away the corrupt data
and start fresh to allow startup to proceed so the user can
get to the UI and restore from backup without having to attach
a console (or otherwise login to the OS and manually modify files).
* test for corruption
* ensure OSError is still fatal
* one more case
* create an issue for corrupt storage
* fix key
* persist
* feedback
* feedback
* better to give the full path
* tweaks
* grammar
* add time
* feedback
* adjust
* try to get issue_domain from storage key
* coverage
* tweak wording some more
2023-07-19 09:23:12 +02:00
Paul Bottein
d8c989f732
Make default theme selectable for set theme service ( #96849 )
2023-07-18 17:36:35 +02:00
Franck Nijhof
b9f92b526b
Add prefix support to text selector ( #96830 )
2023-07-18 12:17:31 +02:00
J. Nick Koston
bc6a41fb94
Remove deprecated state.get_changed_since ( #96579 )
2023-07-18 09:42:48 +02:00
J. Nick Koston
7ec506907c
Ensure async_get_system_info does not fail if supervisor is unavailable ( #96492 )
...
* Ensure async_get_system_info does not fail if supervisor is unavailable
fixes #96470
* fix i/o in the event loop
* fix tests
* handle some more failure cases
* more I/O here
* coverage
* coverage
* Update homeassistant/helpers/system_info.py
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* remove supervisor detection fallback
* Update tests/helpers/test_system_info.py
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-07-16 11:10:07 -04:00
Erik Montnemery
614f3c6a15
Move device info validation to device registry ( #96465 )
...
* Move device info validation to device registry
* Don't move DeviceInfo
* Fix type annotation
* Don't block adding device for unknown config entry
* Fix test
* Remove use of locals()
* Improve error message
2023-07-14 08:55:17 -04:00
Erik Montnemery
7539cf25be
Don't require passing identifiers to DeviceRegistry.async_get_device ( #96479 )
...
* Require keyword arguments to DeviceRegistry.async_get_device
* Update tests
* Update tests
* Don't enforce keyword arguments
2023-07-13 13:39:25 -04:00
J. Nick Koston
08af42b00e
Fix mixed case service schema registration ( #96448 )
2023-07-12 14:39:51 -10:00
Paul Bottein
e513b7d0eb
Add condition selector for blueprint ( #96350 )
...
* Add condition selector for blueprint
* Add tests and validation
* Update comment
2023-07-12 10:58:35 -04:00
Franck Nijhof
594d240a96
Migrate & fix logger services to support translations ( #96393 )
...
* Migrate logger services to support translations
* Fix tests and schema validation
* Apply suggestions from code review
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
---------
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2023-07-12 10:37:18 -04:00
Franck Nijhof
f054de0ad5
Add support for service translations ( #95984 )
2023-07-11 15:52:12 +02:00
Paulus Schoutsen
eee8566694
Differentiate between device info types ( #95641 )
...
* Differentiate between device info types
* Update allowed fields
* Update homeassistant/helpers/entity_platform.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Split up message in 2 lines
* Use dict for device info types
* Extract device info function and test error checking
* Simplify parsing device info
* move checks around
* Simplify more
* Move error checking around
* Fix order
* fallback config entry title to domain
* Remove fallback for name to config entry domain
* Ensure mocked configuration URLs are strings
* one more test case
* Apply suggestions from code review
Co-authored-by: Erik Montnemery <erik@montnemery.com>
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-07-10 09:56:06 -04:00
Erik Montnemery
3d064b7d6b
Add filters to cover/services.yaml ( #95854 )
2023-07-08 11:51:02 +02:00
Jan Bouwhuis
18ee9f4725
Refactor async_get_hass to rely on threading.local instead of a ContextVar ( #96005 )
...
* Test for async_get_hass
* Add Fix
2023-07-07 14:52:38 -04:00
Erik Montnemery
86a397720f
Move platform_integration_no_support issue to the homeassistant integration ( #95927 )
...
* Move platform_integration_no_support issue to the homeassistant integration
* Update test
* Improve repair text
* Update test
2023-07-07 13:31:54 +02:00
J. Nick Koston
b7b8afffd0
Handle integrations with empty services or failing to load during service description enumeration ( #95911 )
...
* wip
* tweaks
* tweaks
* add coverage
* complain loudly as we never execpt this to happen
* ensure not None
* comment it
2023-07-06 11:19:06 -04:00
Jan Bouwhuis
b9c7e7c15e
Fix not including device_name in friendly name if it is None ( #95485 )
...
* Omit device_name in friendly name if it is None
* Fix test
2023-07-06 11:14:09 -04:00
Bram Kragten
342d07cb92
Set correct `response` value in service description when `async_set_service_schema` is used ( #95985 )
...
* Mark scripts as response optional, make it always return a response if return_response is set
* Update test_init.py
* Revert "Update test_init.py"
This reverts commit 8e113e54db
.
* Split + add test
2023-07-06 10:24:34 -04:00
J. Nick Koston
b2e708834f
Add slots to the StateMachine class ( #95849 )
2023-07-05 14:00:37 +02:00
J. Nick Koston
b24c6adc75
Avoid regex for negative zero check in sensor ( #95691 )
...
* Avoid regex for negative zero check in sensor
We can avoid calling the regex for every sensor value
since most of the time values are not negative zero
* tweak
* tweak
* Apply suggestions from code review
* simpler
* cover
* safer and still fast
* safer and still fast
* prep for py3.11
* fix check
* add missing cover
* more coverage
* coverage
* coverage
2023-07-02 21:53:50 -04:00
Paulus Schoutsen
e4f617e92e
Update log message when referenced entity not found ( #95577 )
...
* Update log message when referenced entity not found
* Update homeassistant/helpers/service.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update test
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-07-02 00:04:03 +02:00
Paulus Schoutsen
9280dc69ae
Default device name to config entry title ( #95547 )
...
* Default device name to config entry title
* Only apply name default if device info provided
* Fix logic detecting type of device info
2023-06-30 13:54:20 -04:00
Bram Kragten
a7dfe46fb1
Add conversation agent selector, use in `conversation.process` service ( #95462 )
2023-06-28 21:38:06 -04:00
Paulus Schoutsen
243abf32c0
Add test to stop action ( #95376 )
2023-06-27 19:38:30 +02:00
Franck Nijhof
3e85a29b86
Move overlapping pylint rules to ruff, disable mypy overlap ( #94359 )
2023-06-27 17:42:46 +02:00
Erik Montnemery
071d3a474f
Base entity ids on English for languages not using Latin script ( #91357 )
2023-06-27 14:37:50 +02:00
Paulus Schoutsen
d95c241a1a
Add service response values to service descriptions ( #95262 )
2023-06-26 12:57:43 -04:00
Erik Montnemery
8fda56d2c9
Stable entity registry id when a deleted entity is restored ( #77710 )
...
* Stable entity_id and registry id when a deleted entity is restored
* Don't restore area_id
* Don't restore entity_id
* Address review comments
2023-06-26 15:54:35 +02:00
J. Nick Koston
9051750add
Cache entity translation lookups and keys ( #95180 )
2023-06-25 08:50:48 -05:00
Allen Porter
528c206094
Add script specific error messages for `response_variable` ( #95188 )
2023-06-24 21:34:57 -07:00
Allen Porter
b9b5fe6be8
Add service response data for listing calendar events ( #94759 )
...
* Add service response data for listing calendar events
Add the capability of response data for for the entity component.
* Rename input arguments and add service description
* Improve list events to be more user friendly
Allow the end date to be determined based on a relative time duration. Make the start time optional and set to "now". Add additional test coverage. Update demo calendar to actually perform date range checks.
* Wrap docstrings properly.
* Increase test coverage
* Update to use new API calls
* Readability improvements
* Wrap docstrings
* Require at least one of end or duration
* Check for multiple entity matches earlier in the request
* Update documentation strings
2023-06-23 23:34:34 -04:00
Franck Nijhof
e2f5a707ce
Fix use_device_name in case device device class translations are used ( #95010 )
...
Co-authored-by: Erik <erik@montnemery.com>
2023-06-22 11:30:19 +02:00
J. Nick Koston
8d2daaa694
Limit cache size of EntityValues ( #94983 )
2023-06-21 22:23:35 +02:00
Allen Porter
30e8f806c1
Improve service response data APIs ( #94819 )
...
* Improve service response data APIs
Make the API naming more consistent, and require registration that a
service supports response data so that we can better integrate with
the UI and avoid user confusion with better error messages.
* Improve test coverage
* Add an enum for registering response values
* Assign enum values
* Convert SupportsResponse to StrEnum
* Update service call test docstrings
* Add tiny missing full stop in comment
---------
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-06-20 06:24:31 -07:00
Erik Montnemery
4a8adae146
Teach alarm_control_panel device trigger about entity registry ids ( #60977 )
...
* Teach alarm_control_panel device trigger about entity registry ids
* Lint code
* Address review comment
2023-06-20 08:27:31 -04:00
Erik Montnemery
609a573b55
Regenerate instance ID on error ( #94898 )
2023-06-20 11:16:51 +02:00
Allen Porter
c4284c07b6
Allow scripts to capture service response data in variables ( #94757 )
...
* Allow scripts service actions to save return values
* Simplify script service response data
* Rename result_variable to response_variable based on feedback
2023-06-16 22:59:44 -04:00
J. Nick Koston
68cf796be8
Speed up entity service calls ( #94731 )
...
* Speed up entity service calls
- Avoid permissions check if the caller is an admin
- Use set intersection instead of linear search of entity platforms to find entities
* tweak
* fix light test to not use an admin user
2023-06-16 21:07:57 -04:00
Allen Porter
12129e9d21
Update service call return values and error handling ( #94657 )
...
* Update return signature of service calls
* Add timeout error handling in websocket api for service calls
* Update recorder tests to remove assertion on service call
* Remove timeout behavior and update callers that depend on it today
* Fix tests
* Add missing else
* await coro directly
* Fix more tests
* Update the intent task to use wait instead of timeout
* Remove script service call limits and limit constants
* Update tests that depend on service call limits
* Use wait instead of wait_for and add test
* Update homeassistant/helpers/intent.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-06-16 07:01:40 -07:00
J. Nick Koston
26be0fab78
Fix debouncer not scheduling timer when wrapped function raises ( #94689 )
...
* Fix debouncer not scheduling timer when callback function raises
* test coro as well
* preen
2023-06-15 22:15:49 -04:00
Erik Montnemery
334dacc322
Change Entity.name default to UNDEFINED ( #94574 )
...
* Change Entity.name default to UNDEFINED
* Update typing
* Update Pylint plugin
* Update TTS test
2023-06-15 11:09:53 +02:00
Erik Montnemery
d51982f12f
Add missing assert to test_async_remove_ignores_in_flight_polling ( #94487 )
2023-06-12 21:48:12 +02:00
Erik Montnemery
59f5b8f2d6
Remove unneeded checks for Entity.platform ( #94321 )
...
* Remove unneeded checks for Entity.platform
* Update tests
* Prevent breaking integrations without an EntityComponent
* Warn when entity has no platform
2023-06-09 15:17:41 +02:00
Michael Benz
305fa128fb
Add reload support to intent_script ( #93404 )
...
* support live reload of intent_script
* add services.yaml
* update tesls for full code coverage
* Update based on feedback
* fix intent_script reload when no intent_script config
* Update homeassistant/helpers/intent.py
* update tests to handle no_existing better
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-06-03 14:02:23 -04:00
J. Nick Koston
457bc4571d
Make RestoreStateData.async_get_instance backwards compatible ( #93924 )
2023-06-01 19:31:17 +02:00
Erik Montnemery
f9037d5f6d
Add platform only config schema to nsw_fuel_station and ping ( #93913 )
2023-06-01 17:30:15 +02:00
Erik Montnemery
c1c319d4d1
Rename `cv.no_yaml_config_schema` to `cv.config_entry_only_config_schema` ( #93908 )
...
* Rename cv.no_yaml_config_schema to cv.config_entry_only_config_schema
* ✏️
2023-06-01 13:15:48 +02:00
Erik Montnemery
e0db9ab041
Add CONFIG_SCHEMA to broadlink ( #93854 )
...
* Add CONFIG_SCHEMA to broadlink
* Simplify error message
* Rename to no_yaml_config_schema
* Add tests
* Raise issue
* Tweak repairs issue description and title
* Update homeassistant/helpers/config_validation.py
* Add link
* Update homeassistant/components/homeassistant/strings.json
Co-authored-by: Franck Nijhof <git@frenck.dev>
* Fix logic, add test
---------
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-06-01 09:51:26 +02:00
Erik Montnemery
59c6220b7c
Subscribe to device registry changes from entities ( #93601 )
...
* Subscribe to device registry changes from entities
* Use async_track_device_registry_updated_event
* Fix unsubscribe
* Fix logic, add tests
2023-05-31 11:01:55 +02:00
J. Nick Koston
fba826ae9e
Migrate restore_state helper to use registry loading pattern ( #93773 )
...
* Migrate restore_state helper to use registry loading pattern
As more entities have started using restore_state over time, it
has become a startup bottleneck as each entity being added is
creating a task to load restore state data that is already loaded
since it is a singleton
We now use the same pattern as the registry helpers
* fix refactoring error -- guess I am tired
* fixes
* fix tests
* fix more
* fix more
* fix zha tests
* fix zha tests
* comments
* fix error
* add missing coverage
* s/DATA_RESTORE_STATE_TASK/DATA_RESTORE_STATE/g
2023-05-30 20:48:17 -05:00
J. Nick Koston
9f0d3bfce8
Use ReadOnlyDict for entity registry options ( #93824 )
...
* Use ReadOnlyDict for entity registry options
While reviewing #93601 it was noticed this was slow at startup
https://github.com/home-assistant/core/pull/93601#issuecomment-1568958280
This is a first pass attempt to improve the performance
* fix tests
2023-05-30 20:11:39 -04:00
Ville Skyttä
c7c4ee13c3
Import `util.dt` as `dt_util` in remaining tests, enforce with ruff ( #93765 )
...
* Import `util.dt` as `dt_util` in remaining tests, enforce with ruff
* Fix `util.dt` import in pvpc_hourly_pricing tests
2023-05-30 23:30:31 +03:00
Erik Montnemery
8b662dc94f
Detect attempt to setup config entry integration via YAML ( #93589 )
2023-05-29 21:01:47 +02:00
G Johansson
c6feb30c31
Raise issue "does not support platform setup" ( #93585 )
...
* Raise issue on platform missing
* Modify issue
* Remove deprecation
* Fix strings
* Strings
* Last strings
* strings to common
2023-05-28 21:53:32 +02:00
J. Nick Koston
083cf7a38b
Fix refactoring error with updating polling entities in sequence ( #93693 )
...
* Fix refactoring error with updating in sequence
see #93649
* coverage
* make sure entities are being updated in parallel
* make sure entities are being updated in sequence
2023-05-28 16:20:48 +02:00
Erik Montnemery
49c3a8886f
Make cv.empty_config_schema log an error instead of raise ( #93646 )
...
* Make cv.empty_config_schema log an error instead of raise
* Add test
* Update homeassistant/helpers/config_validation.py
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
---------
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2023-05-28 15:54:22 +02:00
J. Nick Koston
0a9c4f15c4
Add event helper to dispatch device registry updates by device_id ( #93602 )
...
* Add event helper to dispatch device registry updates by device_id
* Update homeassistant/helpers/event.py
* dry
* dry
* reduce
* reduce
* reorder
* reduce
* cleanup stack depth
* dry
* fix double lookup
* remove unused
* collapse
2023-05-27 20:04:09 -04:00
J. Nick Koston
560e744f1e
Reduce overhead to filter entities in the recorder ( #93656 )
...
* Reduce overhead to filter entities in the recorder
* fix type
2023-05-27 19:52:42 -04:00
J. Nick Koston
3a1389c3b4
Switch some frequently called call_laters to call_at ( #93659 )
...
* Switch some frequently called call_laters to call_at
call_at is a bit faster than call_later since call_later
is a wrapper around call_at.
We call at lot of these at startup so it helps a bit when
we are resource constrained
* update test
* update test
2023-05-27 19:45:35 -04:00
J. Nick Koston
f5eb872eaf
Update state helper test to avoid patching utcnow ( #93484 )
2023-05-24 17:38:09 -05:00
Mike Degatano
08a719e09e
Add backup location and mount failed repair ( #93126 )
...
* Add backup location and mount failed repair
* Fix coverage
* Change storage_location to backup_location
* Use backticks
* Update homeassistant/helpers/selector.py
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-05-24 10:33:41 +02:00
J. Nick Koston
b993fe1c9d
Cache generation of the service descriptions ( #93131 )
2023-05-16 21:42:37 -05:00
J. Nick Koston
4c3e98b77c
Fix parallel_updates being acquired too late for entity executor jobs ( #92681 )
...
* Fix parallel_updates being acquired too late for entity executor jobs
* tweak
2023-05-06 16:46:00 +02:00
epenet
70bfbde8aa
Add ability to shutdown a coordinator on STOP ( #92611 )
2023-05-05 16:05:03 +02:00
epenet
6836e15d98
Add type hints to tests ( #92477 )
2023-05-04 11:25:35 +02:00
Bram Kragten
aa4544accb
Add assist pipeline and language selectors ( #92030 )
2023-04-26 18:39:02 +02:00
epenet
79ad9a3646
Shutdown coordinator on entry unload ( #91748 )
...
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-04-21 10:07:31 +02:00
Franck Nijhof
65d7e48815
Update ruff to v0.0.262 ( #91767 )
2023-04-21 08:15:41 +02:00
epenet
ae0cbffdd8
Add ability to shutdown update coordinator ( #91456 )
...
* Add ability to shutdown update coordinator
* Adjust nibe_heatpump
* Add tests
* Use async
* Remove duplicate code in update coordinator
* Adjust
* Revert nibe changes - it can now be done in a follow-up PR
* Adjust
* Fix incorrect merge
* async_fire_time_changed
2023-04-18 18:56:43 +02:00
epenet
81f018b7e5
Make Debouncer shutdown async ( #91542 )
...
* Make shutdown async in Debouncer
* Adjust test
2023-04-17 23:31:30 +02:00
Erik Montnemery
8f8a398631
Support marking an assist pipeline as preferred ( #91418 )
...
* Support marking an assist pipeline as preferred
* Adjust
* Revert unneeded change
* Send preferred pipeline id in pipeline list
* Don't use property functions for the preferred pipeline
2023-04-15 10:05:46 -04:00
J. Nick Koston
56cc6633f5
Use fast path for track_time_change that fires every second ( #91432 )
...
We were missing a check for `*` and were only checking
`None`. Automations use `*`, python code uses `None`.
2023-04-14 21:02:54 -04:00
epenet
19a6530c3c
Add ability to shutdown a Debouncer ( #91439 )
...
* Add ability to shutdown a Debouncer
* Use async_create_task
2023-04-14 21:01:21 -04:00
Franck Nijhof
32344a8488
Fix incorrect warn of async_update_ha_state use ( #91387 )
2023-04-13 22:39:03 +02:00
Franck Nijhof
22a1a6846d
Warn for unneeded use of async_update_ha_state ( #91372 )
2023-04-13 13:49:56 -04:00
Franck Nijhof
d320c73fb7
Use async_write_ha_state in tests ( #91333 )
2023-04-13 12:36:36 +02:00
David Poll
ea12d7a86f
Add pretty printing, key sorting, and better performance to to_json in Jinja ( #91253 )
...
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-04-13 00:32:13 +02:00
epenet
9705607db4
Fix lingering timer in cloud ( #90822 )
...
* Fix lingering timer in cloud
* Rename variable
* Improve
* Improve again
* Adjust
* Adjust
* Add property to HassJob instead
* Adjust
* Rename
* Adjust
* Adjust
* Make it read-only
* Add specific test
2023-04-07 11:38:17 +02:00
Erik Montnemery
59a02cd08c
Allow storing other items than untyped `dict` in `StorageCollection` ( #90932 )
...
Allow storing other items than untyped dict in StorageCollection
2023-04-06 10:57:00 -04:00
Erik Montnemery
fa308d8e10
Drop unused logger argument for StorageCollection() ( #90913 )
2023-04-06 13:28:34 +02:00
epenet
c01b1eb013
Adjust async_track_time_interval name argument ( #90838 )
...
Adjust async_track_time_interval naming
2023-04-05 10:58:02 -04:00
J. Nick Koston
edd93e989e
Add render count to templates repr ( #90753 )
2023-04-03 19:38:15 -10:00
J. Nick Koston
17719663f0
Fix memory churn in state templates ( #90685 )
...
* Fix memory churn in state templates
The LRU for state templates was limited to 512 states. As soon
as it was exaused, system performance would tank as each template
that iterated all states would have to create and GC any state
> 512
* does it scale?
* avoid copy on all
* comment
* preen
* cover
* cover
* comments
* comments
* comments
* preen
* preen
2023-04-02 20:51:25 -04:00
J. Nick Koston
44b35fea47
Speed up entity filter when there are many glob matchers ( #90615 )
...
* Speed up entity filter when there are many glob matchers
Since we do no care about which glob matches we can
combine all the translated globs into a single regex
which reduces the overhead
* delete unused code
* preen
2023-03-31 21:18:29 -04:00
J. Nick Koston
f4c341253b
Avoid sorting domain/all states in templates ( #90608 )
2023-03-31 11:27:55 -10:00
Petro31
642984a042
Fix for is_hidden_entity when using it in select, selectattr, reject, and rejectattr ( #90512 )
...
fix
2023-03-30 09:14:58 -04:00
Erik Montnemery
5bc9545b81
Rename custom_jinja to custom_templates ( #90473 )
...
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-03-29 21:58:25 +02:00
Erik Montnemery
e22618a555
Write protect entity options ( #90185 )
2023-03-28 22:56:51 +02:00
ehendrix23
e45eab600f
Add has_value function/test to Jinja2 template ( #79550 )
2023-03-28 17:04:29 +02:00
Petro31
2123600039
Add minutely updates to relative_time and today_at template functions ( #86815 )
...
* add minutely update
* fix mypy
2023-03-28 15:10:28 +02:00
J. Nick Koston
02ef7d445d
Allow passing an optional name to async_track_time_interval ( #90244 )
...
* Allow passing an optional name to async_track_time_interval
This is the same idea as passing a name to asyncio.create_task which
makes it easier to track down bugs
* more
* short
* still cannot find it
* add a few more
* test
2023-03-25 10:11:14 -04:00
Erik Montnemery
3931e11fd9
Try to load integration before starting option flow ( #90111 )
...
* Try to load integration before starting option flow
* Adjust tests
2023-03-22 20:10:10 +01:00
epenet
0e7bd401f2
Fix lingering timer in config entry flow tests ( #89853 )
2023-03-19 08:56:24 +01:00
epenet
ab6e929443
Fix EntityComponent lingering timer in helper tests ( #89801 )
...
* Fix lingering timer in entity platform tests
* Tweak
* Fix entity and entity_component also
* Remove async_shutdown
* Adjust
* Adjust
2023-03-17 10:26:05 +01:00
epenet
ab4a726e6c
Add tmpdir to known fixtures in pylint ( #89844 )
2023-03-17 10:22:02 +01:00
epenet
79c9447770
Fix lingering timer in event helper tests ( #89819 )
...
Fix lingering timer in event tests
2023-03-16 23:01:23 -04:00
Franck Nijhof
f9919bb7cf
Add pre-defined entity name translations ( #89792 )
2023-03-16 21:10:20 +01:00
epenet
69aa3a75c5
Fix lingering timer in event sun tests ( #89808 )
2023-03-16 18:32:34 +01:00
epenet
1a7e316b51
Fix lingering timer in condition tests ( #89807 )
2023-03-16 18:19:29 +01:00
Erik Montnemery
9384ec18f8
Add filters to climate and light service descriptions ( #86162 )
...
* Add filters to climate and light service descriptions
* Allow specifying enums directly
* Update service descriptions
* Adjust test
* Cache entity features
* Lint
* Improve error handling, add list of known base components
* Don't allow specifying an entity feature as int
2023-03-16 15:59:51 +01:00