Commit Graph

1880 Commits (dev)

Author SHA1 Message Date
G Johansson db3090078b
Remove deprecated support feature values in camera (#146988) 2025-06-22 09:31:16 +02:00
Marc Mueller 2c13c70e12
Update ruff to 0.12.0 (#147106) 2025-06-19 20:39:09 +02:00
karwosts b003429912
Expose statistics selector, use for `recorder.get_statistics` (#147056)
* Expose statistics selector, use for `recorder.get_statistics`

* code review

* syntax formatting

* rerun ci
2025-06-19 20:04:28 +02:00
Erik Montnemery 8d8ff011fc
Minor improvements of service helper (#147079) 2025-06-19 00:17:12 +01:00
Erik Montnemery 058f860be7
Fix incorrect use of zip in service.async_get_all_descriptions (#147013)
* Fix incorrect use of zip in service.async_get_all_descriptions

* Fix lint errors in test
2025-06-17 14:24:31 +02:00
Paulus Schoutsen 059c12798d
Drop user prompt from LLMContext (#146787) 2025-06-13 22:01:39 -04:00
Erik Montnemery e39edcc234
Remove unused attribute EntityInfo.custom_component (#146550) 2025-06-11 17:27:17 +02:00
Erik Montnemery 167e688139
Allow removing entity registry items twice (#146519) 2025-06-11 12:42:09 +02:00
Erik Montnemery c4c8f88765
Simplify helper_integration.async_handle_source_entity_changes (#146516) 2025-06-11 12:27:51 +02:00
Erik Montnemery 2afdec4711
Do not remove derivative config entry when input sensor is removed (#146506)
* Do not remove derivative config entry when input sensor is removed

* Add comments

* Update homeassistant/helpers/helper_integration.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-06-11 11:19:44 +02:00
Erik Montnemery 16a0b7f44e
Handle changes to source entity in derivative helper (#146407)
* Handle changes to source entity in derivative helper

* Rename helper function, improve docstring

* Add tests

* Improve derivative tests

* Deduplicate tests

* Rename helpers/helper_entity.py to helpers/helper_integration.py

* Rename tests
2025-06-10 14:31:18 +02:00
Erik Montnemery ce739fd9b6
Restore entity ID and user customizations of deleted entities (#145278)
* Restore entity ID and user customizations of deleted entities

* Clear removed areas, categories and labels from deleted entities

* Correct test

* Fix logic for disabled_by and hidden_by

* Improve test coverage

* Fix sorting

* Always restore disabled_by and hidden_by

* Update mqtt test

* Update pglab tests
2025-06-10 11:47:54 +02:00
Erik Montnemery 11d9014be0
Restore user customizations of deleted devices (#145191)
* Restore user customizations of deleted devices

* Apply suggestions from code review

* Improve test coverage

* Always restore disabled_by
2025-06-10 11:47:39 +02:00
Erik Montnemery 9d4375ca76
Make async_remove_stale_devices_links_keep_entity_device move entities (#145719)
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2025-05-27 23:00:52 +02:00
Joost Lekkerkerker e2a916ff9d
Make sure we can set up OAuth based integrations via discovery (#145144) 2025-05-26 20:48:07 +02:00
David Poll 670e8dd434
Add as_function to allow macros to return values (#142033) 2025-05-26 20:22:45 +02:00
Erik Montnemery 4e1d5fbeb0
Add WS command to help reset custom entity_id (#145504)
* Add WS command to help reset custom entity_id

* Calculate suggested object id from entity properties

* Fix logic and add additional tests

* Adjust test

* Update folder_watcher test

* Handle current entity id matches the automatic entity id

* Don't store calculated_object_id

* Update snapshots

* Update snapshots

* Update test

* Tweak logic for reusing current entity_id

* Improve test

* Don't assign same entity_id to several entities

* Prioritize custom entity name

* Update snapshots

* Update snapshots
2025-05-26 19:28:27 +02:00
David Poll 13d7234f97
Add apply to make macros/callables useful in filters and tests (#144227) 2025-05-26 17:00:07 +02:00
Petro31 13a6c13b89
Allow base64_encode to support bytes and strings (#145227) 2025-05-26 13:56:11 +02:00
Petro31 25f3ab3640
Add from_hex filter (#145229) 2025-05-26 13:16:56 +02:00
Joost Lekkerkerker 4cd3527761
Enable B009 (#144192) 2025-05-21 16:37:51 +01:00
Erik Montnemery 8938c109c2
Improve entity registry restore test (#145220) 2025-05-19 16:09:23 +02:00
Simone Chemelli 484a547758
Fix pylance warning on SnapshotAssertion import (#145206) 2025-05-19 13:55:48 +02:00
Erik Montnemery f27b2c4df1
Improve device registry restore tests (#145186) 2025-05-19 11:06:16 +02:00
Abílio Costa 6d809b0b5a
Add service response support to admin services (#144837) 2025-05-13 21:57:15 +01:00
Erik Montnemery 0128d85999
Move sun conditions to the sun integration (#144742) 2025-05-12 23:03:37 +01:00
Erik Montnemery 158bbf1f52
Remove unused constant from entity_platform tests (#144601) 2025-05-11 17:33:09 +02:00
J. Nick Koston 2890fc7dd2
Only create a single resolver object if there are multiple aiohttp sessions (#144090) 2025-05-02 13:43:06 -05:00
Allen Porter b16151ac6d
Add an LLM tool for fetching todo list items (#143777)
* Add a tool for fetching todo list items

* Simplify the todo list interface by adding an "all" status

* Update prompt to improve performance on smaller models
2025-04-30 08:49:33 -04:00
Erik Montnemery 16b42cc109
Add cv.renamed (#143834) 2025-04-29 07:36:37 +02:00
Erik Montnemery d860b35f41
Fix flaky test test_async_parallel_updates_with_zero_on_sync_update (#143810) 2025-04-28 09:27:26 +02:00
Erik Montnemery cec8db173b
Remove redundant entity_id collision check in entity registry (#143660)
* Remove redundant entity_id collision check in entity registry

* Update test
2025-04-28 07:50:26 +02:00
J. Nick Koston 34d17ca458
Move state length validation to StateMachine APIs (#143681)
* Move state length validation to StateMachine async_set method

We call validate_state to make sure we do not allow any states
into the state machine that have a length>255 so we do not break
the recorder. Since async_set_internal already requires callers
to pre-validate the state, we can move the check to async_set
instead of at State object creation time to avoid needing to
check it twice in the hot path (entity write state)

* move check in async_set_internal so it only happens on state change

* no need to check if same_state
2025-04-25 21:15:15 -04:00
Petro31 ff2c901930
Update trigger based template entity resolution order (#140660)
* Update trigger based template entity resolution order

* add test

* fix most comments

* Move resolution to base class

* add comment

* remove uncessary if statement

* add more tests

* update availability tests

* update logic stage 1

* phase 2 changes

* fix trigger template entity tests

* fix trigger template entities

* command line tests

* sql tests

* scrape test

* update doc string

* add rest tests

* update sql sensor _update signature

* fix scrape test constructor

* move state check to trigger_entity

* fix comments

* Update homeassistant/components/template/trigger_entity.py

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

* Update homeassistant/helpers/trigger_template_entity.py

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

* Update homeassistant/helpers/trigger_template_entity.py

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

* update command_line and rest

* update scrape

* update sql

* add case to command_line sensor

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2025-04-25 13:17:25 +02:00
Erik Montnemery dc8e1773f1
Remove unused defaults from entity_registry.RegistryEntry (#143655) 2025-04-25 12:41:58 +02:00
J. Nick Koston cb0523660d
Improve error logging when state is too long (#143636) 2025-04-24 18:37:32 -10:00
MichaelMKKelly 35f9cc55f1
Fix Automation/Script: sequence within a parallel ignoring enabled flag (#142977)
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2025-04-19 11:49:05 +02:00
Artur Pragacz 9d02436a72
Remove outdated test for locks (#143061)
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
2025-04-16 18:34:14 +01:00
J. Nick Koston 870350b961
Add async_has_entity_registry_updated_listeners (#142772) 2025-04-14 19:45:09 +02:00
Paul Bottein 8ec436423f
Add template function: device_name (#142683) 2025-04-14 14:30:00 +02:00
Marc Mueller 5f2ae37ee5
Improve backup tests (#142785) 2025-04-14 14:26:29 +02:00
Allen Porter db043b26da
Fix quality loss for LLM conversation agent question answering (#142873)
* Fix a bug parsing a streaming response with no json

* Remove debug lines

* Fix  quality loss for LLM conversation agent question answering

* Update tests
2025-04-14 10:05:34 +02:00
Allen Porter d91528648f
Update ollama to allow selecting mutiple LLM APIs (#142445)
* Update ollama to allow selecting mutiple LLM APIs

* Update homeassistant/helpers/llm.py

* Avoid gather since these don't do I/O

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2025-04-13 15:37:46 -07:00
Erik Montnemery 86622cd29d
Remove unnecessary imports of http integration (#141899)
* Remove unnecessary imports of http integration

* Check reason for test failures

* Revert "Check reason for test failures"

This reverts commit 5ccf356ab0.

* Update tests
2025-03-31 11:30:20 +01:00
John Karabudak 85d2e3d006
Fix LLM to speed up prefill (#141156)
* fix: two minor LLM changes to speed up prefill

- moved the current date/time to the end of the prompt
- started sorting all entities by last_changed

* addressed PR comments

* fixed tests

* reduced scope of try/catch in LLM prompt

* addressed more PR comments

* fixed Anthropic test

* addressed another PR comment

* fixed remainder of tests
2025-03-30 13:30:40 -07:00
alorente 63df2474a9
Fix missing response for queued mode scripts (#141460) 2025-03-28 10:47:41 +00:00
Andrii Mitnovych dea00fac3f
Get area and floor by alias (#126150)
* Add possibility to get area by alias

* Add ability to get floor by alias

* Moved alias lookup to separate function, adjusted templates.

* Changed registry to return all areas/floors with given alias

* Use normalize_name from normalized_name_base_registry
2025-03-27 16:02:47 +01:00
Franck Nijhof eb1caeb770
Add template list functions: intersect, difference, symmetric_difference, union (#141420) 2025-03-26 07:51:25 +01:00
Artur Pragacz 798ee60ae5
Make variables action not restricted to local scopes (#141114)
Make variables action in scripts not restricted to local scopes
2025-03-23 14:07:52 +01:00
Allen Porter 4e2dfba45f
Omit state from the Assist LLM prompts (#141034)
* Omit state from the Assist LLM prompts

* Add back the stateful prompt
2025-03-22 15:41:51 -04:00
Allen Porter a83bf4f514
Add a GetHomeState tool to return the current state of the home (#140971)
* Add a GetHomeState tool to return the current state of the home

* Fix check for exposing entities

* Add "all" to get home state description
2025-03-20 19:37:54 -07:00
Franck Nijhof c6d3928ed1
Add template function: combine (#140948)
* Add template function: combine

* Add test to take away concern raised
2025-03-20 10:29:40 +01:00
Stephan van Rooij 76aef5be9f
Add PKCE implementation in oauth2 helper (#139509)
* Update config_entry_oauth2_flow.py

* Specify type on request_data

* Added LocalOAuth2ImplementationWithPkce

* LocalOAuth2ImplementationWithPkce works more like specs

* fix: Adding tests for pkce flow and feedback applied

* fix last test for pkce

* Clean test_abort_if_oauth_with_pkce_rejected

* Improve assertion of code verifier and code challenge

* Break long docstrings

* Shorten docstring

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-03-17 14:16:52 +01:00
Jan-Philipp Benecke 7b9ea63f17
Split out yaml loading into own package (#140683)
* Split out yaml loading into library

* Code review

* Code review

* Fix check config script
2025-03-15 22:26:18 -04:00
Franck Nijhof e8069e1c07
Add template functions: md5, sha1, sha256, sha512 (#140192) 2025-03-09 16:15:27 +02:00
Franck Nijhof 9aa8a786a5
Add template function: flatten (#140157) 2025-03-08 11:14:27 -10:00
Franck Nijhof e54febdc1e
Add template function: typeof (#140081) 2025-03-08 09:16:21 -10:00
Franck Nijhof d4f205c366
Add template function: shuffle (#140077) 2025-03-07 20:36:17 -05:00
epenet 377e0a64d1
Reset helpers.frame._REPORTED_INTEGRATIONS in between tests (#139924)
* Reset helpers.frame._REPORTED_INTEGRATIONS in between tests

* Rename

* Apply suggestions from code review

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

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2025-03-06 13:57:13 +01:00
Erik Montnemery c51e644203
Prioritize integration_domain passed to helper.frame.report_usage (#139819)
* Prioritize integration_domain passed to helper.frame.report_usage

* Update tests

* Update tests

* Improve docstring

* Rename according to suggestion
2025-03-06 13:16:50 +01:00
epenet 83dd1af6d2
Drop report method from frame helper (#139920)
* Drop report method from frame helper

* Adjust test_prevent_flooding

* Adjust test_report_missing_integration_frame

* Adjust test_report_error_if_integration

* Remove test_report
2025-03-06 11:25:22 +01:00
Erik Montnemery cc5c8bf5e3
Make helpers.frame.report_usage work when called from any thread (#139836)
* Make helpers.frame.report_usage work when called from any thread

* Address review comments, update tests

* Add test

* Update test

* Update recorder test

* Update tests
2025-03-05 19:37:34 +01:00
Erik Montnemery cfaf18f942
Improve the mock_integration_frame test fixture (#139850)
* Improve the mock_integration_frame test fixture

* Update test
2025-03-05 18:42:34 +01:00
Erik Montnemery 1552aec416
Improve frame helper tests (#139843) 2025-03-05 16:13:09 +01:00
Erik Montnemery 09561aeb39
Improve frame helper tests (#139821) 2025-03-05 10:43:29 +01:00
karwosts fa40d02a07
Add model_id filter to device selector (#135646)
* Add model_id filter to device selector

* Rerun CI
2025-03-02 21:15:37 +01:00
Petro31 a296c5e9ad
Add floor_entities function and filter (#136509)
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
2025-02-28 11:44:01 +00:00
Artur Pragacz b964bc58be
Fix variable scopes in scripts (#138883)
Co-authored-by: Erik <erik@montnemery.com>
2025-02-26 16:19:19 +01:00
Erik Montnemery bf190a8a73
Add backup helper (#139199)
* Add backup helper

* Add hassio to stage 1

* Apply same changes to newly merged `webdav` and `azure_storage` to fix inflight conflict

* Address comments, add tests

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2025-02-25 10:19:41 +01:00
Erik Montnemery 428cc1a951
Update signature of platforms' async_setup_entry in tests (#138271) 2025-02-11 13:17:39 +01:00
Erik Montnemery ba583cc669
Add test for trying to add an entity to an unknown config subentry (#138211) 2025-02-10 19:21:43 -05:00
Erik Montnemery 4b34d1bbb5
Merge config subentry feature branch to dev (#136121)
* Reapply "Add support for subentries to config entries" (#133470) (#136061)

* Reapply "Add support for subentries to config entries" (#133470)

This reverts commit ecb3bf79f3.

* Update test snapshot

* Add config subentry support to device registry (#128157)

* Add config subentry support to device registry

* Apply suggestions from code review

* Update syrupy serializer

* Update snapshots

* Address review comments

* Allow a device to be connected to no or a single subentry of a config entry

* Update snapshots

* Revert "Allow a device to be connected to no or a single subentry of a config entry"

This reverts commit ec6f613151cb4a806b7961033c004b71b76510c2.

* Update test snapshots

* Bump release version in comments

* Rename config_subentries to config_entries_subentries

* Add config subentry support to entity registry (#128155)

* Add config subentry support to entity registry

* Update syrupy serializer

* Update snapshots

* Update snapshots

* Accept suggested changes

* Clean registries when removing subentry (#136671)

* Clean up registries when removing subentry

* Update tests

* Clean up subentries from deleted devices when removing config entry (#136669)

* Clean up subentries from deleted devices when removing config entry

* Move

* Add config subentry support to entity platform (#128161)

* Add config subentry support to entity platform

* Rename subentry_id to config_subentry_id

* Store subentry type in subentry (#136687)

* Add reconfigure support to config subentries (#133353)

* Add reconfigure support to config subentries

* Update test

* Minor adjustment

* Rename supported_subentry_flows to supported_subentry_types

* Address review comments

* Add subentry support to kitchen sink (#136755)

* Add subentry support to kitchen sink

* Add subentry reconfigure support to kitchen_sink

* Update kitchen_sink tests with subentry type stored in config entry

* Update kitchen_sink

* Update kitchen_sink

* Adjust kitchen sink tests

* Fix hassfest

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Improve docstrings and strings.json

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-02-10 16:40:07 +01:00
Artur Pragacz 6d6961ae6e
Clean up colliding deleted devices when updating non-deleted devices (#135592)
* Fix Schrödinger's devices

* Address feedback

* Add comment with broader context
2025-02-07 14:44:44 +01:00
Paulus Schoutsen ac42c9386c
Simplify llm calendar tool (#137402)
* Simplify calendar tool

* Clean up exposed entities
2025-02-05 11:42:41 +01:00
epenet 4d2c46959e
Add coordinator unsubscribe listener test (#137422) 2025-02-05 11:15:25 +01:00
epenet c3b40e681d
Fix data update coordinator garbage collection (#137299) 2025-02-04 11:20:06 +01:00
Paulus Schoutsen dd9bd8ef73
Make get_chat_session a callback context manager (#137146) 2025-02-01 23:37:24 -05:00
Paulus Schoutsen 2f6640707b
Extract conversation ID generation to helper (#137062)
* Extract conversation ID generation to helper

* Allow nested get_chat_log calls
2025-02-01 20:54:00 -05:00
tronikos d4586fb2e4
Test config_entry_oauth2_flow.async_get_redirect_uri (#136976)
* Test config_entry_oauth2_flow.async_get_redirect_uri

* review
2025-02-01 12:49:18 +01:00
Denis Shulyaka 85540cea3f
Add LLM ActionTool (#136591)
Add ActionTool
2025-01-27 14:21:27 -05:00
Michael Hansen 7497beefed
Add single target constraint to async_match_targets (#136643)
Add single target constraint
2025-01-27 14:06:21 -05:00
Paulus Schoutsen 005ae3ace6
Allow LLMs to get calendar events from exposed calendars (#136304) 2025-01-23 17:54:04 -05:00
epenet b11b36b523
Add more util aliases to import conventions (#136153) 2025-01-21 15:58:23 +01:00
Ville Skyttä 40eb8b91cc
Adjust to recommended propcache.api import paths (#136150) 2025-01-21 10:58:22 +01:00
epenet 364556a7dd
Prefer from...import...as over import...as in core tests (#136146) 2025-01-21 09:28:17 +01:00
Erik Montnemery 235fda55fe
Validate config entry when adding or updating entity registry entry (#135067) 2025-01-17 19:18:13 +01:00
Petro31 566f514a75
Allow is_state_attr to check attributes for None (#132879) 2025-01-17 08:41:10 +01:00
Konrad Vité e6c696933f
Fix DiscoveryFlowHandler when discovery_function returns bool (#133563)
Co-authored-by: J. Nick Koston <nick@koston.org>
2025-01-16 12:31:16 -10:00
Paulus Schoutsen 5cf56207fe
Add temperature and humidity entities to area registry (#135423)
* Add temperature and humidity entities to area registry

* Fix service test

* Add validation

* ABC

* More ABC

* More ABC 2

* Fix tests

* ABC 3

* ABC 4
2025-01-16 08:25:26 -05:00
Artur Pragacz 1de4d0efda
Fix deprecated enums (#134824) 2025-01-14 10:04:48 +01:00
Artur Pragacz b009f11013
Fix referenced objects in script sequences (#135499) 2025-01-13 11:40:53 +01:00
epenet 5df7092f41
Improve formatting in core files (#135256)
* Adjust core files formatting

* Adjust translations script
2025-01-10 09:08:37 +01:00
Allen Porter 6e111d18ec
Allow unregistering LLM APIs (#135162) 2025-01-09 08:18:25 -08:00
Erik Montnemery 5888b83f22
Validate device id when adding or updating entity registry entry (#134982) 2025-01-07 16:10:51 +00:00
Franck Nijhof 00c052bb22
Revert "Remove deprecated supported features warning in ..." (multiple) (#134933) 2025-01-07 00:08:02 +01:00
J. Nick Koston 89c73f56b1
Migrate to using aiohttp-asyncmdnsresolver for aiohttp resolver (#134830) 2025-01-06 12:06:28 -10:00
Craig Andrews 9e8df72c0d
Improve is docker env checks (#132404)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Sander Hoentjen <sander@hoentjen.eu>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Robert Resch <robert@resch.dev>
2025-01-02 17:21:49 +01:00
epenet 899fb091fc
Simplify access to hass in service calls (#133062) 2024-12-13 09:31:21 +01:00
epenet f2500e5a32
Remove deprecated supported features warning in MediaPlayer (#132365) 2024-12-09 23:03:55 +01:00
Allen Porter 35438f65e5
Update exception handling for python3.13 for getpass.getuser() (#132449)
* Update exception handling for python3.13 for getpass.getuser()

* Add comment

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Cleanup trailing space

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-06 06:54:21 -08:00