Commit Graph

2866 Commits (92a6f231a989ceda4a07613ebfa86f53c360034f)

Author SHA1 Message Date
J. Nick Koston 9ec26a9be5
Fix getting the current host for IPv6 urls (#126889) 2024-09-27 11:26:35 +02:00
Erik Montnemery 3c0be47d3c
Add FlowManager.async_has_matching_flow (#126804)
* Add FlowManager.async_flow_has_matching_flow

* Revert changes from the future

* Apply suggested changes to apple_tv config flow

* Rename methods after discussion

* Update homeassistant/data_entry_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Move deduplication functions to config_entries, add tests

* Adjust tests

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-27 10:51:36 +02:00
J. Nick Koston 75ae6a8087
Fix getting the host for the current request (#126882) 2024-09-27 03:36:05 -05:00
Joost Lekkerkerker 3810c3cbaf
Improve trigger schema validation to ask for `trigger` instead of `platform` (#126750)
* Add check for missing trigger

* Fix

* Fix

* Escape
2024-09-25 16:44:14 +02:00
Joost Lekkerkerker 33d83e43de
Update trigger validation message (#126749) 2024-09-25 15:33:03 +02: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
starkillerOG 69ecdda5f5
Add SSL Cipher option to aiohttp async_get_clientsession (#126317)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-24 21:31:52 +02:00
G Johansson 93aade6e8e
Change lock state to an enum (#126379)
* Add new LockState enum for lock states

* Add rest

* Fix insteon tests

* Fix mqtt tests

* Fix tesla_fleet

* Revert back ST_STATE_LOCKED

* Add back constant
2024-09-24 12:30:50 +02:00
Erik Montnemery b2982c18bb
Reinitialize zeroconf discovery flow on unignore (#125753)
* Reinitialize zeroconf discovery flow on unignore

* Adjust tests

* Improve comments

* Fix logic for updating discovery keys

* Add tests

* Use mock_config_flow helper in new config_entries test

* Add discovery_keys attribute to ConfigEntry

* Update zeroconf rediscovery

* Change type of ConfigEntry.discovery_keys

* Update tests

* Fix DiscoveryKey.from_json_dict and add tests

* Fix test

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-23 16:49:21 +02:00
J. Nick Koston 0e0ac3efe5
Remove uneeded isoformat calls in registry as_storage_fragment properties (#126440) 2024-09-23 14:23:43 +02:00
epenet cd95c133af
Enable all TID ruff rules (#126312)
* Enable ruff rule TID252

* One more

* comment
2024-09-20 12:25:51 +02:00
Alberto Montes 28ece89272
Update string formatting to use f-string on core codebase (#125988)
* Update string formatting to use f-string on core codebase

* Small change given review feedback
2024-09-19 14:31:13 +02:00
Paul Bottein b471a6e519
Add has_entity_name to entity display dict and fix name (#125832)
* Add has_entity_name to entity display dict and fix name

* Fix tests
2024-09-19 11:35:44 +02:00
epenet 88cacbc898
Expose component constants for llm helper (#125891)
* Expose climate INTENT_GET_TEMPERATURE

* Expose conversation trace items

* More fixes for llm helper
2024-09-13 12:43:37 +02:00
chammp b3377fe5fb
Add condition to trigger template entities (#119689)
* Add conditions to trigger template entities

* Add tests

* Fix ruff error

* Ruff

* Apply suggestions from code review

* Deduplicate

* Tweak name used in debug message

* Add and improve type annotations of modified code

* Adjust typing

* Adjust typing

* Add typing and remove unused parameter

* Adjust typing

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

* Adjust return type

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

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-09-11 09:36:49 +02:00
Erik Montnemery ded34561b1
Simplify cv._base_trigger_list_flatten (#125613) 2024-09-09 21:14:41 +02:00
karwosts 056e6eae82
Add a syntax for merging lists of triggers (#117698)
* Add a syntax for merging lists of triggers

* Updating to the new syntax

* Update homeassistant/helpers/config_validation.py

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

* fix suggestion

* update test and add comments

* not actually json

* move test to new file

* update tests

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-09-09 13:51:32 +02:00
Denis Shulyaka a85ccb94e3
LLM Tool parameters check (#123621)
* LLM Tool parameters check

* fix tests
2024-09-08 18:42:51 -07:00
J. Nick Koston 051a28b55a
Remove unneeded wrapping of URL in URL in network helper (#125265)
* Remove unneeded wrapping of URL in URL in network helper

* fix mocks
2024-09-06 15:34:52 +02:00
Robert Resch 4d96ed4c68
Update modified_at datetime on storage collection changes (#125218) 2024-09-04 15:05:51 +02:00
Erik Montnemery 8759a6a14d
Make optional arguments to frame.report kwarg only (#125062)
* Make optional arguments to frame.report kwarg only

* Update homeassistant/helpers/frame.py

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-09-03 17:03:36 +02:00
Erik Montnemery cf10549df4
Restore unnecessary assignment of Template.hass in event helper (#125143) 2024-09-03 15:25:35 +02:00
Erik Montnemery c321bd70e1
Log deprecation warning when `cv.template` is called from wrong thread (#125141)
Log deprecation warning when cv.template is called from wrong thread
2024-09-03 14:37:21 +02:00
Erik Montnemery 851600630c
Log deprecation warning when `template.Template` is created without `hass` (#125142)
* Log deprecation warning when template.Template is created without hass

* Improve docstring
2024-09-03 14:28:33 +02:00
Artur Pragacz fb27297df9
Fix area registry indexing when there is a name collision (#125050) 2024-09-02 09:23:07 -10:00
Erik Montnemery df4bd721b5
Deprecate template.attach (#124843) 2024-09-02 15:33:10 +02:00
Erik Montnemery baa876d4d9
Remove lying comment from service.async_register_entity_service (#125079) 2024-09-02 15:18:02 +02:00
Erik Montnemery 114e254aa6
Don't raise when registering entity service with invalid schema (#125057)
* Don't raise when registering entity service with invalid schema

* Update homeassistant/helpers/service.py

Co-authored-by: Robert Resch <robert@resch.dev>

---------

Co-authored-by: Robert Resch <robert@resch.dev>
2024-09-02 14:20:50 +02:00
G Johansson 78cf7dc873
New template merge_response (#114204)
* New template merge_response

* Extending

* Extend comment

* Update

* Fixes

* Fix comments

* Mods

* snapshots

* Fixes from discussion
2024-09-02 08:13:10 +02:00
J. Nick Koston 0a9e20615e
Limit maximum template render output to 256KiB (#124946)
* Limit maximum template render output to 256KiB

fixes #124931

256KiB is likely to still block the event loop for an unreasonable amont of
time but its likely someone is using the template engine for large
blocks of data so we want a limit which still allows that but has
a reasonable safety to prevent the system from crashing down

* Update homeassistant/helpers/template.py
2024-08-30 22:33:57 +02:00
Erik Montnemery 174f22aa2f
Prevent nesting sections in data entry flows (#124645) 2024-08-28 15:42:15 +02:00
Erik Montnemery c772c4a2d5
Allow specifying icons for service sections (#124656)
* Allow specifying icons for service sections

* Improve kitchen_sink example
2024-08-28 11:15:26 +02:00
Erik Montnemery 55c42fde88
Improve validation of entity service schemas (#124102)
* Improve validation of entity service schemas

* Update tests/helpers/test_entity_platform.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-27 19:05:49 +02:00
Petro31 5d64155bb6
Add zip to template engine (#122460)
* add zip to template engine

* fix doc strings
2024-08-22 19:11:08 +02:00
Erik Montnemery 533442f33e
Add async friendly helper for validating config schemas (#123800)
* Add async friendly helper for validating config schemas

* Improve docstrings

* Add tests
2024-08-17 11:01:49 +02:00
Erik Montnemery f1b7847d1c
Simplify cv._make_entity_service_schema (#124046) 2024-08-16 14:09:09 +02:00
Erik Montnemery 69943af68a
Deduplicate async_register_entity_service (#124045) 2024-08-16 14:06:35 +02:00
Erik Montnemery 799e95c1bd
Do sanity check in EntityComponent.async_register_entity_service schema (#124029)
* Do sanity check in EntityComponent.async_register_entity_service schema

* Improve test
2024-08-16 13:39:25 +02:00
Erik Montnemery f9ade788eb
Do sanity check EntityPlatform.async_register_entity_service schema (#123058)
* Do a sanity check of schema passed to EntityPlatform.async_register_entity_service

* Only attempt to check schema of Schema

* Handle All/Any wrapped in schema

* Clarify comment

* Apply suggestions from code review

Co-authored-by: Robert Resch <robert@resch.dev>

---------

Co-authored-by: Robert Resch <robert@resch.dev>
2024-08-16 10:01:12 +02:00
Erik Montnemery e1a0a855d5
Support None schema in EntityComponent.async_register_entity_service (#123867) 2024-08-14 11:44:38 +02:00
Erik Montnemery 7063541733
Support None schema in EntityPlatform.async_register_entity_service (#123064) 2024-08-14 10:46:29 +02:00
Erik Montnemery 78f7b3340d
Remove unnecessary assignment of Template.hass from event helper (#123777) 2024-08-13 12:09:30 +02:00
Erik Montnemery 992de497f2
Remove unnecessary assignment of Template.hass from script helper (#123780) 2024-08-13 11:55:37 +02:00
Erik Montnemery 6317053cc6
Remove unnecessary assignment of Template.hass from condition helper (#123775) 2024-08-13 11:52:27 +02:00
Erik Montnemery c49a31e0de
Remove unnecessary assignment of Template.hass from script variables helper (#123712) 2024-08-12 21:51:24 +02:00
Erik Montnemery c5e8710889
Remove unnecessary assignment of Template.hass from service helper (#123710) 2024-08-12 21:51:02 +02:00
Erik Montnemery 6caec89793
Remove unnecessary assignment of Template.hass from trigger entity helper (#123709) 2024-08-12 21:50:50 +02:00
J. Nick Koston 69740e865c
Reduce number of aiohttp.TCPConnector cleanup_closed checks to one per minute (#123268) 2024-08-08 15:52:09 -05:00
epenet ddc94030a6
Fix raise-within-try in config validation helper (#123353) 2024-08-08 18:50:49 +02:00
Erik Montnemery 449afe9e6f
Correct type annotation for `EntityPlatform.async_register_entity_service` (#123054)
Correct type annotation for EntityPlatform.async_register_entity_service

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-08-02 11:58:07 +02:00