Commit Graph

2050 Commits (9b839041fa288f84a539f8c157d91821c9e86ff0)

Author SHA1 Message Date
G Johansson 6ad4e13b38
Manual trigger entity and refactor command_line switch (#91506)
* TriggerEntity to CoordinatorTriggerEntity

* _render_templates

* split manual vs coordinator

* name

* ManualTriggerEntity

* value

* Remove ManualTriggerEntity

* ManualTriggerEntity

* process_manual_data

* Add test

* imports

* Move ManualTriggerEntity

* cmd_line switch

* Review comments

* Fix templating

* Review comments

* Remove unneeded logging
2023-05-08 10:19:37 +02: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
Michael Hansen 74560ab139
Skip unexposed entities in intent handlers (#92415)
* Filter intent handler entities by exposure

* Add test for skipping unexposed entities
2023-05-03 12:18:31 -04:00
Erik Montnemery 0126cfa9d9
Allow exposing any entity to the default conversation agent (#92398)
* Allow exposing any entity to the default conversation agent

* Tweak

* Fix race, update tests

* Update tests
2023-05-03 09:45:54 -04:00
Bram Kragten aa4544accb
Add assist pipeline and language selectors (#92030) 2023-04-26 18:39:02 +02:00
G Johansson 1fa82fa886
Move TriggerBaseEntity into helpers (#91945)
* Move TriggerBaseEntity

* mypy
2023-04-25 09:56:40 +02:00
J. Nick Koston fba7c6cacd
Remove deprecated async_get_registry (#91928)
Deprecated in 2021 via #46265, report was added a year ago in #72088
2023-04-23 23:02:21 -04: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
Erik Montnemery 03dcb915e3
Add missing callback decorator on StorageCollectionWebsocket.ws_list_item (#91727) 2023-04-20 07:58:11 -04: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 28652345bd
Remove duplicate code in update coordinator (#91573) 2023-04-17 13:07:58 -10:00
epenet 81f018b7e5
Make Debouncer shutdown async (#91542)
* Make shutdown async in Debouncer

* Adjust test
2023-04-17 23:31:30 +02:00
Paulus Schoutsen bd22e0bd43
Allow picking a pipeline for voip devices (#91524)
* Allow picking a pipeline for voip device

* Add tests

* Fix test

* Adjust on new pipeline data
2023-04-17 12:09:11 -05:00
Michael 67c4de90f3
Add option to select list of accepted ssl ciphers in httpx client (#91389) 2023-04-15 09:32:30 -10:00
epenet a018ba0696
Improve async_track_point_in_time (#91451)
* Adjust async_track_point_in_time

* Adjust name
2023-04-15 20:28:08 +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
J. Nick Koston 5ffd833fdf
Improve performance of tracking time changes (#91433)
* Improve performance of async_track_time_interval

Uses HassJob internally to avoid looking up the function
target type every time it fires

* name
2023-04-14 21:02:13 -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
epenet 9744e72d5a
Add ability to auto-cancel track_time_interval (#91381) 2023-04-13 21:31:16 +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 445b823232
Avoid task creation when calling schedule_update_ha_state without force update (#91352) 2023-04-13 18:39:03 +02:00
epenet 4a0988eb5d
Adjust shutdown registration in EntityComponent (#90938)
* Adjust shutdown registration in EntityComponent

* Adjust

* Make it more explicit

* docstring
2023-04-13 08:47:04 +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
Erik Montnemery 2c9e9d0fde
Allow UI configuration of entities exposed to voice_assistant (#91233)
* Allow UI configuration of entities exposed to voice_assistant

* Invalidate cache when settings change

* Add tests

* Expose entities to conversation by default

* Update tests
2023-04-11 22:39:40 -04:00
rlippmann 3a72054f93
Make dataclasses in HA core slotted (#91208) 2023-04-11 07:58:28 -10:00
J. Nick Koston 3d1556a4a2
Switch back to using call_later for the slow entity update warning (#91067)
* Switch back to using call_later for the slow entity update warning

I had originally changed this to create a task and wait
in #41184 but that does not make sense anymore with newer
cpython as the profile now shows the original method is cheaper
(or I did it wrong the first time)

* fix missing block till done since there is no longer a task being created which would run the event loop once
2023-04-08 22:22:56 -04:00
Marc Mueller b2bcdf7c19
Update mypy to 1.2.0 (#90947)
* Update mypy to 1.2.0

* Add type ignore
2023-04-06 12:51:16 -04: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 5eb0c35a97
Add names to common helper tasks (#90803) 2023-04-05 08:41:15 +02:00
Erik Montnemery 37661fe79f
Update template environment from the event loop (#90758) 2023-04-04 09:52:47 +02: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 3e94f2a502
Small speed up to _collection_changed (#90621)
attrgetter builds a fast method which happens in native code
4664a7cf68/Modules/_operator.c (L1413)
2023-03-31 21:15:36 -04:00
J. Nick Koston f4c341253b
Avoid sorting domain/all states in templates (#90608) 2023-03-31 11:27:55 -10:00
Erik Montnemery 149e610bca
Drop __eq__ dunder method from Entity (#90585) 2023-03-31 17:03:02 +02:00
J. Nick Koston 2e0ecf9bd9
Avoid more task creation in the discovery helper (#90552)
* Avoid more task creation in the discovery helper

There is no longer a reason to awaiti the jobs being dispatched
since nothing was using the result and there is no risk of
job being garbage collected prematurely anymore since
the task revamp

* Update homeassistant/helpers/discovery.py
2023-03-31 09:10:55 +02: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 b207790177
Fix benign typo in discovery flow helper (#90396) 2023-03-28 13:01:41 +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
J. Nick Koston 1f2268a878
Fix httpx client creating a new ssl context with each client (memory leak) (#90191)
* Fix httpx client creating a new ssl context with each client

While working on https://github.com/home-assistant/core/issues/83524
it was discovered that each new httpx client creates a new ssl context

f1157dbc41/httpx/_transports/default.py (L261)

If an ssl context is passed in creating a new one is avoided here

f1157dbc41/httpx/_config.py (L110)

This change makes httpx ssl no-verify behavior match aiohttp ssl no-verify
behavior

6da04694fd/aiohttp/connector.py (L892)

aiohttp solved this by wrapping the code that generates the ssl context
in an lru_cache

* compact
2023-03-24 08:40:47 +01:00
J. Nick Koston 87264d219a
Fix ssl context being recreated frequently in httpx (#89932)
* Fix ssl context being created every time in httpx

* its expensive, only do it once
2023-03-19 05:13:48 -04:00
J. Nick Koston 30e7ab247d
Small cleanups to writing entity state (#89890)
* Small cleanups to writing entity state

* reduce one prop access

* small cleanups

* small cleanups

* name conflict
2023-03-17 20:32:24 -04: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
Erik Montnemery 886c2635ad
Add support for constant selector (#89573)
* Add support for constant selector

* Adapt to frontend PR changes
2023-03-16 09:02:26 -04:00
Franck Nijhof f32b7859b8
Restructure translations for entity components (#89702) 2023-03-16 12:16:08 +01:00
epenet 913156b0e0
Avoid lingering timer on script shutdown (#89753) 2023-03-16 08:00:21 +01:00
Penny Wood 858fc30fcd
Fix infinite loop in sun.sun (#89723) 2023-03-14 16:27:29 -10:00
David Poll 0457bb2717
Add is_hidden_entity test for Jinja templates (#89011) 2023-03-13 18:20:33 +01:00
David Poll 7284af6a3e
Add an in-memory-preloading loader for Jinja imports (#88850)
* Adds a loader to enable jinja imports.

* Switch to in-memory

* Move loading custom_jinja off of the event loop

* Raise TemplateNotFound if template doesn't exist

* Fix docstring

* Adds a service to reload custom jinja

* Remove IO from test setup

* Improve coverage and small refactor

* Incorporate feedback and use .jinja extension

* Check the loaded sources in test.

* Incorporate PR feedback.

* Update homeassistant/helpers/template.py

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

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-03-13 11:00:05 +01:00
J. Nick Koston 0575b9bc88
Increase maximum aiohttp connections to 4096 (#89611)
fixes #89408
2023-03-12 16:57:22 -10:00
Erik Montnemery cf7e500a8e
Support translating entity names (#88242) 2023-03-12 15:55:04 +01:00
epenet 029093d0b2
Fix lingering timer in device registry (#89422) 2023-03-10 09:48:58 -05:00
Lucas Mindêllo de Andrade eed16dc185
Add list areas function to template (#88441) 2023-03-09 22:32:30 +01:00
epenet 48fca3bb27
Fix missing debouncer cancel in update coordinator (#89383)
* Fix missing debouncer cancel in update coordinator

* Improve

* Adjust with comment

* Adjust again

* Simplify PR

* Adjust tests to avoid lingering timer

* Improve
2023-03-09 15:16:52 -05:00
epenet dbebe57d51
Avoid unnecessary Task in debouncer (#89370) 2023-03-09 11:41:59 +01:00
Marc Mueller 386533a16f
Update mypy to 1.1.1 (#89268)
* Update mypy to 1.1.1
* Update pydantic to 1.10.6
2023-03-08 22:57:54 +01:00
J. Nick Koston e1d62b554a
Migrate integration_platform helper to use async_get_integrations (#89303)
* Migrate integration_platform helper to use async_get_integrations

We were fetching integrations inside the gather one
at a time. This is inefficent.

* cleanup

* cleanup

* add task name

* small tweaks

* gather only if we have tasks
2023-03-08 16:01:47 -05:00
J. Nick Koston cefba7c638
Avoid falling back to listening for all states when a template render raises an exception (#89392)
When a template render raised an exception we would start listening for
all states until the template did not raise an exception anymore. This
was not needed since the entity that is causing the exception was
already in the tracker.

Re-rendering on all state changes can be extremely expensive and can
bring an instance into a sluggish or unresponsive state when updating
from a much older version that did not raise ValueError when a default
was missing.
2023-03-08 15:50:34 -05:00
Erik Montnemery 18cb53a35c
Pass hass instance when validating templates (#89242)
* Pass hass instance when validating templates

* Update tests

* Fix validating templates without hass

* Update service tests
2023-03-08 11:28:53 -05:00
J. Nick Koston aff7345ea0
Improve event filters to reject earlier (#89337)
* Improve event filters to reject earlier

- Avoid running the callbacks for state added/removed from
  a domain if there are no listeners that care about the domain

- Remove some impossible checks in the listeners that will
  never match since they were already rejected by the filter

* leave one guard since there is a race when we return control via await
2023-03-08 10:25:42 -05:00
J. Nick Koston 11681f3f31
Pass a helpful name when creating common asyncio tasks in core (#89171) 2023-03-05 12:46:02 +01:00
Paul Bottein e95944bf9f
Add filter options to entity and device selectors (#87536)
* Add support for multiple device classes

* Add support for entity filter selector

* Add support for device filter selector

* Apply suggestions

* Fix wrong property name

* Update snapshot

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-02-27 10:38:18 -05:00
J. Nick Koston bea81d3f63
Fix lock services not removing entity fields (#88805) 2023-02-26 18:59:28 -05:00
J. Nick Koston 57360a7528
Prevent new discovery flows from being created when stopping (#88743) 2023-02-25 12:02:07 +01:00
J. Nick Koston f52a5f6965
Make hass.async_stop an untracked task (#88738) 2023-02-24 23:11:48 -05:00
J. Nick Koston 0223058d25
Reduce overhead to save json data to postgresql (#88717)
* Reduce overhead to strip nulls from json

* Reduce overhead to strip nulls from json

* small cleanup
2023-02-24 21:37:36 -05:00
Erik Montnemery d90ee85118
Allow conditions to be implemented in platforms (#88509)
* Allow conditions to be implemented in platforms

* Update tests

* Tweak typing

* Rebase fixes
2023-02-23 22:30:51 -05:00
David Poll af49b98475
Enable jinja loop controls (break/continue) (#88625)
Enables jinja loop controls (break/continue)
2023-02-23 22:14:28 -05:00
Erik Montnemery 1f34fa63ab
Always include platform in `config/entity_registry/list_for_display` (#88601)
Always include platform in config/entity_registry/list_for_display
2023-02-22 17:59:52 +01:00
Erik Montnemery 6d9411b8a1
Improve trigger platform typing (#88511)
* Improve trigger platform typing

* Tweak docstring

* Revert "Tweak docstring"

This reverts commit c31f790fc3.

* Tweak docstring
2023-02-22 11:59:53 +01:00
J. Nick Koston 8806c3dd20
Speed up loading non-english language translations (#88553)
Speed up loading non-english languages

We called async_get_integrations in each gathered task
instead of once for both languages we were loading
2023-02-21 21:18:33 -05:00
Erik Montnemery 0c4c95394e
Add WS command config/entity_registry/list_for_display (#87787)
* Add WS command config/entity_registry/list_for_display

* Make more keys in the display dict optional

* Move disabled_by check to ws command handler

* Hide hidden_by if not hidden

* Use send_json_auto_id in the new test

* Don't include entities which have no data needed for display

* Include platform for entries with translation_key
2023-02-21 20:40:39 +01:00
Erik Montnemery 30ebc6604f
Invert trigger._PLATFORM_ALIASES (#88503) 2023-02-20 22:14:41 +01:00
Erik Montnemery cc4a179ca8
Support templating for in state conditions (#88411) 2023-02-20 18:57:00 +01:00
Erik Montnemery 83e5bf7ae8
Use entity_sources to determine integration in recorder platforms (#88382) 2023-02-18 07:21:41 -06:00
Michael Hansen dc30210237
Use blocking in intent service calls and verify results (#88035)
* Use blocking in service calls and verify result

* Block for 2 seconds and update states after

* Small timeout in service call to allow exceptions

* Move sun test
2023-02-16 14:01:41 -05:00
epenet ba23816a0c
Inverse json import logic (#88099)
* Fix helpers and util

* Adjust components

* Move back errors

* Add report

* mypy

* mypy

* Assert deprecation messages

* Move test_json_loads_object

* Adjust tests

* Fix rebase

* Adjust pylint plugin

* Fix plugin

* Adjust references

* Adjust backup tests
2023-02-16 11:37:57 +01:00
J. Nick Koston c0e22be7a8
Fix allowing identical flows to be created before startup (#88213)
The check for identical flows only worked after
the start event. We now check against pending
flows as well

If startup took a while we could end up
with quite the thundering herd
2023-02-15 21:36:00 -05:00
Franck Nijhof 9030ca05b1
Enable Ruff SIM118 (#87772) 2023-02-15 12:39:12 +01:00
epenet a1b7842df2
Fix incorrect reference to json WriteError (#88161) 2023-02-15 10:40:26 +01:00
J. Nick Koston e41af8928b
Restore original aiohttp cancelation behavior (#88046) 2023-02-13 22:00:36 -06:00
J. Nick Koston ac97097167
Speed up template lru_caches (#87942)
By avoiding the argument unpacking these functions are faster
and reduce stack overhead
2023-02-12 14:13:13 -05:00
J. Nick Koston e19f8595fa
Small cleanups to template helper (#87944)
- reduce dict lookups
- avoid split_entity_id
2023-02-12 14:11:48 -05:00
J. Nick Koston aa8927c98c
Speed up loops with jinja templates (#87945) 2023-02-12 18:40:55 +01:00
Michael Hansen 8cd5106c15
Add HassGetState intent for queries (#87808)
* Use names instead of entity ids for list

* Add HassGetState for Assist queries

* Add unknown area to test

* Clean up and test device classes
2023-02-09 23:39:46 -05:00
Erik Montnemery cc564026fa
Move EntityCategory to homeassistant.const (#87792)
* Move EntityCategory to homeassistant.const

* Fix more imports
2023-02-09 20:15:37 +01:00
Erik Montnemery 8ccb3b7151
Fix circular import loop in homeassistant/helpers/entity.py (#87780)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-02-09 19:15:53 +01:00
Erik Montnemery 2d2ff19949
Round value in state_with_unit template function (#87619) 2023-02-09 12:54:59 +01:00
Erik Montnemery 93dafefd96
Include entity options in RegistryEntry.as_partial_dict (#87539) 2023-02-08 08:32:46 -05:00
epenet a202588fd2
Add return type to json_loads (#85672)
* Add JSON type definitions

* Sample use

* Keep mutable for a follo-up PR (avoid dead code)

* Use list/dict

* Remove JsonObjectType

* Remove reference to Union

* Cleanup

* Improve rest

* Rename json_dict => json_data

* Add docstring

* Add type hint to json_loads

* Add cast

* Move type alias to json helpers

* Cleanup

* Create and use json_loads_object

* Make error more explicit and add tests

* Use JsonObjectType in conversation

* Remove quotes
2023-02-07 17:21:55 +01:00
Marc Mueller 42008c50f3
Enable error-code `truthy-iterable` [mypy 1.0] (#87596) 2023-02-07 11:16:22 +01:00
Marc Mueller ea4e2ab4aa
Add Self typing (4) [mypy 1.0] (#87601) 2023-02-06 22:30:22 -06:00
Marc Mueller 342b406dc0
Add Self typing (1) [mypy 1.0] (#87598) 2023-02-06 22:29:47 -06:00
Paulus Schoutsen a090652560
Use correct state in Entity repr and output similar value to State class (#87519)
* Use correct state in Entity repr

* Test Entity.__repr__

* Align with State class
2023-02-06 13:35:36 -05:00
krahabb 899342d391
Refactor async_call_later to improve performance and reduce conversion loss (#87117)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-02-05 12:04:38 -06:00
Franck Nijhof fcb612cd6f
Collection of code styling tweaks (#87344) 2023-02-03 23:51:27 +01:00
Erik Montnemery 4d4fb2477d
Optionally update sensor units when unit system is changed (#83851) 2023-02-03 16:30:50 +01:00
epenet 810367b757
Fix `can not` typo (#87254) 2023-02-03 11:37:16 +01:00
Franck Nijhof b8a1f87073
Fix schema typing on async_register_entity_service (#87250) 2023-02-03 11:25:02 +01:00
Karlie Meads e40a9822f5
Fix disabled condition within an automation action (#87213)
fixes undefined
2023-02-02 22:35:02 +01:00
Franck Nijhof 5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Marc Mueller 07a3046d11
Update pylint to 2.16.0 (#87083) 2023-02-02 12:49:01 +01:00
Michael Hansen be69c81db5
Prioritize entity names over area names in Assist matching (#86982)
* Refactor async_match_states

* Check entity name after state, before aliases

* Give entity name matches priority over area names

* Don't force result to have area

* Add area alias in tests

* Move name/area list creation back

* Clean up PR

* More clean up
2023-01-30 23:46:25 -05:00
Michael Hansen adeaf746ec
Use device area id in intent matching (#86678)
* Use device area id when matching

* Normalize whitespace in response

* Add extra test entity
2023-01-26 09:48:49 -06:00
Erik Montnemery fea30c1ce9
Terminate strings at NUL when recording states and events (#86687) 2023-01-26 11:11:03 +01:00
Paulus Schoutsen df0fc30695
Fix oauth2 error (#86634) 2023-01-25 20:50:16 +01:00
Vaarlion 3007e0259d
Add a `contains` jinja filter and test (#86390) 2023-01-25 11:51:47 +01:00
Michael Hansen ea95abcb30
Use intent responses from home-assistant-intents (#86484)
* Use intent responses from home_assistant_intents

* Use error responses from home_assistant_intents

* Remove speech checks for intent tests (set by conversation now)

* Bump hassil and home-assistant-intents versions

* Use Home Assistant JSON reader when loading intents

* Remove speech checks for light tests (done in agent)

* Add more tests for code coverage

* Add test for reloading on new component

* Add test for non-default response
2023-01-23 22:38:41 -05:00
Marc Mueller 6f94e47270
Update Union typing (6) [Py310] (#86454) 2023-01-23 15:01:07 +01:00
Marc Mueller 4f87c1f30f
Update pre-commit-config [Py310] (#86415) 2023-01-23 09:59:44 +01:00
Marc Mueller 6397138589
Update Optional typing (1) [Py310] (#86417)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-23 09:56:10 +01:00
Marc Mueller da35097803
Update Optional typing (2) [Py310] (#86419) 2023-01-23 09:10:05 +01:00
Marc Mueller 8abce25948
Update Union typing (4) [Py310] (#86427) 2023-01-23 09:04:40 +01:00
Marc Mueller 45b4b0e990
Import `ParamSpec` from typing [Py310] (#86413)
* Import ParamSpec from typing [Py310]

* Update additional imports
2023-01-23 07:28:43 +01:00
J. Nick Koston ca4d7634a8
Switch an `asyncio.wait_for` in the template helper to `async_timeout` (#86349)
Switch an asyncio.wait_for in the template helper to async_timeout

Eliminates the extra task when calling async_render_will_timeout
2023-01-22 00:02:03 +02:00
Franck Nijhof 79b52a2b41
Stricter pylint message control (#86154) 2023-01-20 13:47:55 +01:00
Aarni Koskela 656632f504
Fix docstring in helpers.template_entity (#86227) 2023-01-19 21:24:44 -05:00
Michael Hansen 5aca996f22
HassTurnOn/Off intents to also handle cover entities (#86206)
* Move entity/area resolution to async_match_states

* Special case for covers in HassTurnOn/Off

* Enable light color/brightness on areas

* Remove async_register from default agent

* Remove CONFIG_SCHEMA from conversation component

* Fix intent tests

* Fix light test

* Move entity/area resolution to async_match_states

* Special case for covers in HassTurnOn/Off

* Enable light color/brightness on areas

* Remove async_register from default agent

* Remove CONFIG_SCHEMA from conversation component

* Fix intent tests

* Fix light test

* Fix humidifier intent handlers

* Remove DATA_CONFIG for conversation

* Copy ServiceIntentHandler code to light

* Add proper errors to humidifier intent handlers
2023-01-19 17:15:01 -06:00
Jan Bouwhuis 25392655e7
Allow translating select selector options (#85531)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-01-17 16:22:19 +01:00
Erik Montnemery 788edc21fb
Deduplicate some entity registry code (#85541) 2023-01-16 22:06:52 +01:00
Karlie Meads 156307f3f2
Fix logic of disabled condition for "OR" (#79718) 2023-01-16 21:08:09 +01:00
Allen Porter 1afb4897a8
Add a timeout during OAuth token exchange and additional debug logging (#85911) 2023-01-16 19:52:43 +01:00
Franck Nijhof 64c2340fab
Core code styling improvements (#85963) 2023-01-15 23:00:51 +01:00
Erik Montnemery 8983f665cf
Refactor device registry JSON cache (#85539) 2023-01-09 09:50:27 -10:00
Erik Montnemery b933a53aa3
Refactor entity registry JSON cache (#85085)
* Refactor entity registry JSON cache

* Fix generator

* Tweak

* Improve string building

* Improve test coverage

* Override EntityRegistryItems.values to avoid __iter__ overhead
2023-01-09 16:52:52 +01:00
Franck Nijhof 06a35fb7db
Code styling tweaks to core helpers (#85441) 2023-01-08 13:44:09 -10:00
J. Nick Koston a18a629c19
Avoid pattern search entry when there are no patterns in the entity filter (#85404) 2023-01-07 14:40:58 -10:00
Michael Hansen ecaec0332d
Hassil intents (#85156)
* Add hassil to requirements

* Add intent sentences

* Update sentences

* Use hassil to recognize intents in conversation

* Fix tests

* Bump hassil due to dependency conflict

* Add dataclasses-json package contraints

* Bump hassil (removes dataclasses-json dependency)

* Remove climate sentences until intents are supported

* Move I/O outside event loop

* Bump hassil to 0.2.3

* Fix light tests

* Handle areas in intents

* Clean up code according to suggestions

* Remove sentences from repo

* Use home-assistant-intents package

* Apply suggestions from code review

* Flake8

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-01-07 16:20:21 -05:00
J. Nick Koston 194adcde9c
Drop ChainMap in translation cache (#85260) 2023-01-06 11:52:18 -10:00
Marc Mueller 516cb31635
Fix multi inheritance with CoordinatorEntity (#85053) 2023-01-03 23:07:59 +01:00
J. Nick Koston d89c259d7e
Fix double time conversion in async_track_point_in_utc_time (#85036) 2023-01-03 20:21:54 +01:00
Marc Mueller 972eb34ed9
Improve `bluetooth` generic typing (#84891)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-02 21:19:53 -10:00
Franck Nijhof 5cfa98e400
Improve typing of SelectorConfig (#85022) 2023-01-02 18:52:15 -05:00
Erik Montnemery 11c174aca3
Revert "Add aliases to device registry items" (#84976) 2023-01-02 12:30:25 +01:00
Joakim Plate 5c43f0861f
Avoid running final writes in executor in test (#84679) 2022-12-28 23:40:11 +01:00
Franck Nijhof d4f69a3652
String formatting and max line length - Part 7 (#84532)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-12-27 11:18:56 +01:00
Erik Montnemery 1a42bd5c4c
Add aliases to area registry items (#84294)
* Add aliases to area registry items

* Update test

* Fix WS API
2022-12-21 08:44:44 +01:00
Erik Montnemery 057bb6ea0a
Add aliases to device registry items (#84246) 2022-12-20 23:43:31 +01:00
Erik Montnemery 1f3da9cf1a
Add aliases to entity registry items (#84239) 2022-12-20 12:10:46 +01:00
Erik Montnemery fd9124279b
Add minor version to area registry store (#84280) 2022-12-20 11:41:35 +01:00