Commit graph

1879 commits

Author SHA1 Message Date
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