Commit graph

776 commits

Author SHA1 Message Date
Chris Browet
5a2bcd2763
ADD: generalize regex_findall () 2021-09-05 12:41:39 +02:00
Erik Montnemery
bfd799dc04
Use hass_client_no_auth test fixture in integrations s-x () 2021-09-02 14:50:10 +02:00
Raman Gupta
4d98a7e156
Allow device_id template function to use device name as input () 2021-08-31 14:56:47 +02:00
Raman Gupta
1d1b5ab345
Fix area_id and area_name template functions () 2021-08-30 13:09:41 -07:00
Raman Gupta
2f7a7b0309
Add template functions to get area_id and area_name ()
* Add template function to get area_id

* fix int bug

* Prefer area name lookup

* remove unnecessary checks

* fix import

* Add area_name function

* change behavior to fail in ambiguous scenarios

* Revert lotto winning exception checking

* review comments

* try except else
2021-08-25 15:16:51 -04:00
Børge Nordli
0d654fa6b3
Extract attribute names out of vol.Optional when validating entity service schema () 2021-08-25 13:00:11 +02:00
Raman Gupta
036e99e91e
Allow integrations to define trigger platforms with a subtype () 2021-08-19 21:43:04 -07:00
Richard T. Schaefer
3184f0697f
Add Save Persistent States service () 2021-08-10 00:38:56 +02:00
Paulus Schoutsen
952d11cb03
Ensure internal/external URL have no path ()
* Ensure internal/external URL have no path

* Fix comment typo

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-09 09:38:09 +02:00
Joakim Sørensen
3f2e18fe17
Add user to homeassistant system health () 2021-08-03 11:58:27 +02:00
Robert Svensson
c6213b36ad
Only disable a device if all associated config entries are disabled () 2021-07-29 12:08:53 -07:00
Franck Nijhof
1968b95829
Add currency core configuration ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-07-28 08:55:58 +02:00
Raman Gupta
73bc0267e9
Add DeviceRegistry template functions () 2021-07-27 18:55:55 -04:00
Raman Gupta
bef8be9256
Support dynamic schema validation in device conditions and actions ()
* Allow integrations to provide dynamic schema validation in device conditions and actions

* Add tests

* re-add type

* mypy
2021-06-28 09:23:46 +02:00
Eduard van Valkenburg
779ef3c8e1
Add timedelta option for async_call_later () 2021-06-12 13:14:35 +02:00
Erik Montnemery
b01b33c304
Add trigger condition ()
* Add trigger condition

* Tweaks, add tests
2021-06-11 15:05:57 +02:00
Ville Skyttä
7d03b02192
Spelling fixes () 2021-06-11 13:35:03 +02:00
Franck Nijhof
4c51299dcc
Add easy converting string timestamps/dates to datetime objects in templates () 2021-06-07 15:02:15 +02:00
Franck Nijhof
f35929ba63
Allow referencing sensor entities for before/after in time conditions ()
* Allow referencing sensor entities for before/after in time conditions

* Fix typo in variable naming

* Improve test coverage
2021-06-07 14:50:31 +02:00
Franck Nijhof
05241a7a68
Allow number/sensor entities in numeric state conditions/triggers () 2021-06-04 18:14:48 +02:00
Paulus Schoutsen
ede7932a57
Protect our user agent ()
* Protect our user agent

* Fix expected error
2021-06-04 09:14:18 -07:00
Paulus Schoutsen
ee2c950716
Merge system options into pref properties ()
* Make system options future proof

* Update tests

* Add types
2021-06-01 22:34:31 +02:00
Franck Nijhof
c5dc99c052
Fix time condition microsecond offset when using input helpers () 2021-06-01 17:57:23 +02:00
Paulus Schoutsen
45e1473f83
Improve config validation for key_value_schemas () 2021-06-01 11:23:59 +02:00
Paulus Schoutsen
f472219c68
Set up cloud semi-dependencies at start () 2021-06-01 01:35:31 +02:00
Paulus Schoutsen
4821484d2c
Add system option to disable polling () 2021-05-31 15:36:40 -07:00
Raman Gupta
58e37435b3
Make more max lengths constants and add additional MaxLengthExceeded checks ()
* Add more MaxLengthExceeded checks

* remove some validations to reduce performance impact

* check length of generated entity ID

* dont check entity ID twice and use single context id length constant

* fix test

* add missing test
2021-05-25 19:58:01 +02:00
Franck Nijhof
c5383219f1
Remove stale debug statements from tests () 2021-05-25 11:52:20 +02:00
Erik Montnemery
1ea0d8ae02
Correct trace of condition actions () 2021-05-17 16:54:17 -07:00
Joakim Sørensen
2f10f59717
Block custom integrations with missing or invalid version () 2021-05-17 15:48:41 +02:00
Erik Montnemery
b35f229674
Include _StopScript.__cause__ in trace ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-05-11 22:27:11 -07:00
J. Nick Koston
bf2d40adfe
Migrate from pytz to python-dateutil ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-05-07 22:46:26 -07:00
Ville Skyttä
77d5244577
Use device registry CONNECTION_* constants () 2021-04-30 23:58:50 +02:00
Franck Nijhof
c68b259bd3
Cleanup of unused connection_class logic ()
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-04-29 23:12:58 +02:00
Erik Montnemery
d2fd504442
Limit precision when stringifying float states ()
* Limit precision when stringifying float states

* Add test

* Fix typing

* Move StateType

* Update

* Move conversion to entity helper

* Address review comments

* Tweak precision

* Tweak

* Make _stringify_state an instance method
2021-04-27 21:48:24 +02:00
Ville Skyttä
153d6e891e
Use config_entries.SOURCE_* constants () 2021-04-25 11:27:40 +02:00
Ville Skyttä
a396619251
Use disabled_by constants ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-04-23 09:56:42 +02:00
Erik Montnemery
d28b959a09
Improve sun condition trace () 2021-04-22 16:46:27 -07:00
J. Nick Koston
f96a6e878f
Ensure restore state is not written after the stop event ()
If everything lined up, the states could be written
while Home Assistant is shutting down after the stop
event because the interval tracker was not canceled on
the stop event.
2021-04-17 09:03:18 +02:00
Mike Degatano
236d274351
Add search and match as Jinja tests () 2021-04-15 20:13:27 +02:00
J. Nick Koston
8bee25c938
Fix stop listener memory leak in DataUpdateCoordinator on retry ()
* Fix stop listener leak in DataUpdateCoordinator

When an integration retries setup it will add a new stop listener

* Skip scheduled refreshes when hass is stopping

* Update homeassistant/helpers/update_coordinator.py

* ensure manual refresh after stop
2021-04-14 12:16:59 -10:00
Tobias Sauerwein
9d4ad1821e
Fix logic of entity id extraction ()
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-04-14 14:12:26 +02:00
J. Nick Koston
44beff31c2
Cancel config entry retry, platform retry, and polling at the stop event () 2021-04-13 16:16:26 -10:00
Raman Gupta
769923e8dd
Raise exception for invalid call to DeviceRegistry.async_get_or_create ()
* Raise exception instead of returning None for DeviceRegistry.async_get_or_create

* fix entity_platform logic
2021-04-13 14:18:51 +02:00
J. Nick Koston
53853f035d
Prevent calling stop or restart services during db upgrade () 2021-04-12 17:18:38 -07:00
Erik Montnemery
ff5fbea1fb
Improve trace of template conditions ()
* Improve trace of template conditions

* Refactor

* Fix wait_template trace

* Update tests
2021-04-12 20:22:28 +02:00
Franck Nijhof
a610076001 Support min()/max() as template function () 2021-04-12 10:02:04 +02:00
Erik Montnemery
7e4be921a8
Add helper to get an entity's supported features ()
* Add helper to check entity's supported features

* Move get_supported_features to helpers/entity.py, add tests

* Fix error handling and improve tests
2021-04-10 08:19:16 +02:00
Jason
7cc857a298
Add custom JSONEncoder for subscribe_trigger WS endpoint () 2021-04-09 20:47:10 -07:00
Erik Montnemery
16196e2e16
Don't log template errors from developer tool () 2021-04-09 12:10:02 -07:00