1794 Commits

Author SHA1 Message Date
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
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
epenet
c6568ffb62
Fix lingering timer in collection helper tests (#89793)
* Fix lingering timer in collection helper tests

* One more
2023-03-16 08:38:22 -04:00
Franck Nijhof
f32b7859b8
Restructure translations for entity components (#89702) 2023-03-16 12:16:08 +01:00
epenet
46a5aa71ec
Add type hints to helper tests (#89784) 2023-03-16 11:10:56 +01:00
epenet
913156b0e0
Avoid lingering timer on script shutdown (#89753) 2023-03-16 08:00:21 +01:00
epenet
3aa5629665
Improve type hints in condition helper tests (#89754) 2023-03-15 19:42:23 +01:00
epenet
54ad8b8ee9
Avoid lingering timers in update coordinator tests (#89749) 2023-03-15 18:50:32 +01:00
epenet
35c02ddc81
Add type hints to update coordinator tests (#89748) 2023-03-15 18:07:43 +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
epenet
a0f725dfcb
Add type hints to tests (#89497) 2023-03-10 12:06:50 +01: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
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
Erik Montnemery
bc0b3abb01
Remove unittest.TestCase from service helper tests (#89283)
* Remove unittest.TestCase from service helper tests

* Update

* Improve tests
2023-03-07 16:54:35 +01:00
epenet
5cab63c5b8
Fix lingering task in debounce tests (#89019)
* Fix lingering task in debounce tests

* Correct fix

* Use async_fire_time_changed
2023-03-02 13:01:50 -05:00
epenet
b84eead3f8
Adjust entity registry access in helper tests (#88965) 2023-03-01 16:24:31 +01:00
epenet
6febe00516
Fix lingering task in entity_platform test (#88957)
* Fix lingering task in entity_platform test

* Speed up the test
2023-03-01 10:49:13 +01:00
epenet
6ab0b2751d
Adjust issue_registry imports (#88878)
* Add issue_registry to RUFF extend aliases

* Adjust code accordingly

* Revert "Add issue_registry to RUFF extend aliases"

This reverts commit 4e73dd567be42c74d0db4a51bac8d7aa9d7c93e7.

* Revert changes to common.py
2023-02-28 21:55:44 -05:00
Michael Hansen
e0bdb3ecc3
Update intent sentences package (#88933)
* Actually use translated state names in response

* Change test result now that locks are excluded from HassTurnOn

* Bump home-assistant-intents and hassil versions
2023-02-28 21:07:18 -05: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
57360a7528
Prevent new discovery flows from being created when stopping (#88743) 2023-02-25 12:02:07 +01: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
Michael Hansen
59f2b2ad51
Bump intents package version; hassil==1.0.5; home-assistant-intents==2023.2.22 (#88605)
* Bump hassil and intents versions

* Adjust tests to handle abbreviated responses
2023-02-22 09:36:42 -06:00
Erik Montnemery
cc4a179ca8
Support templating for in state conditions (#88411) 2023-02-20 18:57:00 +01:00
epenet
5f25b71df7
Add type hints to core tests (#88478) 2023-02-20 11:42:56 +01:00
Franck Nijhof
1e05697080
Enable Ruff B007 (#88356)
* Enable Ruff B007

* Adjust existing cases
2023-02-17 21:08:18 -05:00
Michael Hansen
325674ec44
Only expose default cloud domains in Assist default agent (#88274)
* Only expose default cloud domains in default agent

* Copy exposed domain list to conversation

* Implement requested changes

* Add test for exposed devices/areas
2023-02-17 16:19:22 -05:00
epenet
185cd61cbd
Add type hints to integration tests (recorder) (#88313) 2023-02-17 18:50:09 +01:00
epenet
3873484849
Refactor json tests to align with new code (#88247)
* Refactor json tests to align with new code

* Use tmp_path
2023-02-16 21:34:19 +01: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