Commit Graph

1164 Commits (0f80d0625afae93228e9e25e686a9d89c52be2e4)

Author SHA1 Message Date
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
Franck Nijhof 73c4ac53d2
Enable T20 (flake8-print) to ban use of print statements (#86525)
* Enable T20 (flake8-print) to ban use of print statements

* Make compatible with flake8 config
2023-01-24 14:24:21 +01:00
epenet 30bf0634fe
Add per-file-ignore to pylint (#86289) 2023-01-22 17:26:24 +01:00
Erik Montnemery 1e2f00e186
Improve device automation validation (#86143) 2023-01-21 00:44:17 +01: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
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
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
Paulus Schoutsen 9ed629d838
Fix some pytest warning for helpers (#85283) 2023-01-06 09:21:46 +01:00
Erik Montnemery 11c174aca3
Revert "Add aliases to device registry items" (#84976) 2023-01-02 12:30:25 +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
Erik Montnemery c4afc33fc5
Add abc.ABC to classes with abstract methods (#83546) 2022-12-08 17:50:36 +01:00
Erik Montnemery 8e617bbc1d
Add `translation_key` property to entites (#82701)
* Add translation_key attribute to entity state

* Update accuweather test

* Index entity translation keys by platform

* Store translation key in entity registry
2022-12-01 09:34:09 +01:00
Mike Degatano b3deb476ef
Allow is_state to accept a list of values (#81877)
* Allow is_state to accept a list of values

* Slightly more efficient

* Fix typing of state

Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-11-30 22:54:14 +01:00
epenet 98f263c289
Make SchemaFlowFormStep functions async (#82962)
* Make validate async in SchemaOptionsFlowHandler

* Adjust group

* Adjust tests

* Move all to async

* Adjust integrations

* Missed an integration

* Missed one

* Rebase to fix conflict
2022-11-30 12:26:52 +01:00
epenet 663482fb10
Add flow_state to SchemaCommonFlowHandler (#82967)
* Add local_context to SchemaCommonFlowHandler

* Rename to context

* Rename to flow_state
2022-11-30 10:18:57 +01:00
Joakim Plate c576a68d33
Upgrade pytest-aiohttp (#82475)
* Upgrade pytest-aiohttp

* Make sure executors, tasks and timers are closed

Some test will trigger warnings on garbage collect, these warnings
spills over into next test.

Some test trigger tasks that raise errors on shutdown, these spill
over into next test.

This is to mimic older pytest-aiohttp and it's behaviour on test
cleanup.

Discussions on similar changes for pytest-aiohttp are here:
https://github.com/pytest-dev/pytest-asyncio/pull/309

* Replace loop with event_loop

* Make sure time is frozen for tests

* Make sure the ConditionType is not async

  /home-assistant/homeassistant/helpers/template.py:2082: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
    def wrapper(*args, **kwargs):
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

* Increase litejet press tests with a factor 10

The times are simulated anyway, and we can't stop the normal
event from occuring.

* Use async handlers for aiohttp

tests/components/motioneye/test_camera.py::test_get_still_image_from_camera
tests/components/motioneye/test_camera.py::test_get_still_image_from_camera
tests/components/motioneye/test_camera.py::test_get_stream_from_camera
tests/components/motioneye/test_camera.py::test_get_stream_from_camera
tests/components/motioneye/test_camera.py::test_camera_option_stream_url_template
tests/components/motioneye/test_camera.py::test_camera_option_stream_url_template
  /Users/joakim/src/hass/home-assistant/venv/lib/python3.9/site-packages/aiohttp/web_urldispatcher.py:189: DeprecationWarning: Bare functions are deprecated, use async ones
    warnings.warn(

* Switch to freezegun in modbus tests

The tests allowed clock to tick in between steps

* Make sure skybell object are fully mocked

Old tests would trigger attempts to post to could services:

```
DEBUG:aioskybell:HTTP post https://cloud.myskybell.com/api/v3/login/ Request with headers: {'content-type': 'application/json', 'accept': '*/*', 'x-skybell-app-id': 'd2b542c7-a7e4-4e1e-b77d-2b76911c7c46', 'x-skybell-client-id': '1f36a3c0-6dee-4997-a6db-4e1c67338e57'}
```

* Fix sorting that broke after rebase
2022-11-29 22:36:36 +01:00
epenet 987c7a28a9
Add tests for suggested_values in SchemaFlowFormStep (#82906)
* Add tests

* Add test for merging user input
2022-11-29 11:09:12 +01:00
Marc Mueller 63d519c1a8
Spelling updates (#82867) 2022-11-28 16:51:43 +01:00
Erik Montnemery effa9940ff
Save migrated store data (#82523) 2022-11-28 09:42:08 -05:00
Erik Montnemery e9ce08763c
Allow SchemaFlowFormStep.next_step to return None (#82707) 2022-11-25 16:00:26 +01:00
epenet fd3e996a1e
Merge test files (#82703) 2022-11-25 15:11:09 +01:00
epenet 6c615016b8
Fix None schema in SchemaCommonFlowHandler (#82699) 2022-11-25 14:30:02 +01:00
Erik Montnemery e1338adf1a
Allow configuring country and language in core config (#81734)
* Allow configuring country and language in core config

* Add script for updating list of countries

* Use black for formatting

* Fix quoting

* Move country codes to a separate file

* Address review comments

* Add generated/countries.py

* Get default language from owner account

* Remove unused variable

* Add script to generate list of supported languages

* Add tests

* Fix stale docsring

* Use format_python_namespace

* Correct async_user_store

* Improve typing

* Fix with_store decorator

* Initialize language in core store migration

* Fix startup

* Tweak

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Update storage.py

Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-11-24 23:25:50 +01:00
epenet caa99ea9fb
Allow next_step to be a string (#82647)
* Allow next_step to be a string

* Adjust docstrings

* Add test
2022-11-24 18:55:53 +01:00
Erik Montnemery 8577310e6d
Fix show_menu support in SchemaFlowFormStep (#82634)
* Fix show_menu support in SchemaFlowFormStep

* Add test

* Fix test
2022-11-24 17:30:01 +01:00
On Freund 9dd1b85cbb
Allow `device_attr` and `is_device_attr` to be used as a filter and a test (respectively) (#81924)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2022-11-24 08:31:17 +01:00
epenet 6b85d17e7c
Add type hints to template tests (#82566) 2022-11-23 20:28:52 +01:00
epenet 9d192643ee
Move PluggableAction to trigger helpers (#81900)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Joakim Plate <elupus@ecce.se>
Co-authored-by: Shay Levy <levyshay1@gmail.com>
2022-11-22 11:35:18 +01:00
Erik Montnemery c3d4a9cd99
Create repairs issue if an outdated currency code is configured (#81717)
* Create repairs issue if an outdated currency code is configured

* Add script for updating list of currencies

* Use black for formatting

* Move currency codes to a separate file

* Address review comments
2022-11-08 07:21:09 +01:00
Petro31 f73fc9e355
Adds states and state_attr as a filter, adds is_state and is_state_attr as a test. (#79473) 2022-10-25 19:49:51 +02:00
Erik Montnemery aea0067e49
Add additional rules for converting distances (#80940)
* Add additional rules for converting distances

* Convert in to mm

* Adjust existing tests

* Add test
2022-10-25 12:51:23 +02:00
Franck Nijhof 326344db12
Rename entry_id template method to config_entry_id (#80935) 2022-10-25 12:11:14 +02:00
Erik Montnemery 6979cd95b0
Add suggested_unit_of_measurement attribute to sensors (#80638)
* Add suggested_unit_of_measurement attribute to sensors

* Lazy calculation of initial entity options

* Add type alias for entity options

* Small tweak

* Add tests

* Store suggested_unit_of_measurement in its own option key

* Adapt to renaming of IMPERIAL_SYSTEM

* Fix rebase mistakes

* Apply suggestions from code review

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

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-10-24 16:08:02 +02:00
epenet 8a1cc05e0c
Enforce kwargs in unit system initialisation (#80620)
* Enforce kwargs in unit system initialisation

* Fix tests

* Sort kwargs in unit_system
2022-10-20 10:43:32 +02:00
Erik Montnemery 31a787558f
Ensure recorder test fixture is setup before hass fixture (#80528)
* Ensure recorder test fixture is setup before hass fixture

* Adjust more tests
2022-10-19 07:58:47 +02:00
Franck Nijhof dd266b7119
Remove elevation warning from sun (#80239) 2022-10-14 15:23:44 +02:00
Janick Bergeron f21a004aa9
Fix before sunrise OR after sunset condition (#76143)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Ben Randall <veleek@gmail.com>
2022-10-14 13:11:10 +02:00
Erik Montnemery 59d9d3de69
Add at_started helper (#79577) 2022-10-05 12:24:51 +02:00
ehendrix23 47b40e1e61
Add optional default value to average template function/filter (#77499)
* Return None on empty list

* Updated to use default value

* Update comment.
2022-10-03 10:07:19 +02:00
ehendrix23 ba6a81c565
Resolve traceback error when using variables in template triggers (#77287)
Co-authored-by: Erik <erik@montnemery.com>
2022-09-29 13:26:28 -04:00
Rami Mosleh e7764b8bf1
Add ConfigEntry template function (#78030)
* Add ConfigEntry template function

* Remove looking up entry_id by entry title
2022-09-29 12:41:59 +02:00
Erik Montnemery c38b1e7727
Improve check of new_entity_id in entity_registry.async_update_entity (#78276)
* Improve check of new_entity_id in entity_registry.async_update_entity

* Fix race in rfxtrx config flow

* Make sure Event is created on time

* Rename poorly named variable

* Fix typing

* Correct typing of _handle_state_change
2022-09-28 08:43:58 +02:00
Erik Montnemery 53263ea9bc
Revert "Add serial_number to device registry entries" (#79139) 2022-09-27 16:36:38 +02:00
Erik Montnemery cba3b6ad94
Add serial_number to device registry entries (#77713) 2022-09-27 09:08:54 +02:00
Joakim Sørensen 8dbe293ae2
Add version to templates (#78484) 2022-09-15 15:01:40 +02:00
Erik Montnemery 84a812ad05
Allow setting number selector step size to 'any' (#78265)
* Allow setting number selector step size to 'any'

* Improve test coverage
2022-09-15 08:29:46 +02:00
Erik Montnemery 4e32bf2ac9
Drop old migration code from entity registry (#78278) 2022-09-12 22:28:05 -04:00
Erik Montnemery e332091d76
Improve unique_id collision checks in entity_platform (#78132) 2022-09-09 14:35:23 +02:00
Erik Montnemery b0d033ef29
Add mixin class CollectionEntity for the collection helper (#77703)
* Add mixin class CollectionEntity for the collection helper

* Improve typing

* Address review comments

* Fix tests
2022-09-03 12:56:49 +02:00
Erik Montnemery 51c5f1d16a
Remove useless device_registry test (#77714) 2022-09-02 20:44:42 +00:00
Erik Montnemery 1bc8770b51
Remove area_id from entity_registry.async_get_or_create (#77700)
* Remove area_id from entity_registry.async_get_or_create

* Adjust tests

* Fix lying comment in test
2022-09-02 13:31:05 +02:00
Erik Montnemery 8924725d69
Improve some device registry tests (#77659) 2022-09-02 08:54:02 +02:00
Erik Montnemery cd2045b66d
Clean up user overridden device class in entity registry (#77662) 2022-09-01 11:45:19 -04:00
Erik Montnemery 4655ed995e
Fix resetting of attributes in EntityRegistry.async_get_or_create (#77516)
* Fix resetting of attributes in EntityRegistry.async_get_or_create

* Fix typing

* Fix resetting config entry

* Improve test

* Update tests
2022-08-30 21:07:50 +02:00
Franck Nijhof dfc3e7d80f
Don't expose attribute option in state selector (#77347) 2022-08-26 11:51:36 +02:00
Erik Montnemery dfed3ba75e
Move issue_registry to homeassistant.helpers (#77299)
* Move issue_registry to homeassistant.helpers

* Add backwards compatibility
2022-08-25 11:32:06 +02:00
Franck Nijhof dc17bca00c
Add config entry selector (#77108) 2022-08-24 00:29:30 +02:00
Franck Nijhof 9843753f30
Add alias support to all triggers (#77184) 2022-08-22 17:43:09 -04:00
Franck Nijhof 5a0e4fa5ee
Add hide attribute support to attribute selector (#77072)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-08-22 12:55:30 +02:00
Franck Nijhof 453307e01a
Add attribute support to state selector (#77071) 2022-08-20 13:30:38 -04:00
Franck Nijhof 2d197fd59e
Add state selector (#77024)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-08-19 09:24:53 -04:00
Paulus Schoutsen 6e92931087
Add file selector and file upload integration (#76672) 2022-08-18 12:02:12 -04:00
Franck Nijhof e65018fb85
Clean up deprecated connection class remainders (#75421) 2022-07-18 21:14:41 -07:00
Franck Nijhof 7adb0f0ef5
Custom component -> Custom integration (#75404) 2022-07-18 22:10:22 +02:00
J. Nick Koston 9a27f1437d
Use default encoder when saving storage (#75319) 2022-07-17 14:25:19 +02:00
J. Nick Koston 61cc9f5288
Consolidate executor jobs when loading integration manifests (#75176) 2022-07-14 13:06:08 -07:00
Erik Montnemery 2e228b2608
Tweak handling of entities with `has_entity_name` set (#74948)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-07-11 15:10:53 -07:00
J. Nick Koston da027fa390
JSON serialize NamedTuple subclasses with aiohttp (#74971) 2022-07-11 14:46:55 -07:00
Allen Porter f4e61eff18
Add update coordinator for google calendar (#74690)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-07-10 21:24:52 -07:00
J. Nick Koston a697672944
Add bluetooth integration (#74653)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-07-08 18:55:31 -05:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
J. Nick Koston e2fe1a1c5d
Allow tuple subclasses to be json serialized (#74207) 2022-06-29 19:14:56 -05:00
J. Nick Koston a8349a4866
Adjust entity filters to make includes stronger than excludes (#74080)
* Adjust entity filters to make includes stronger than excludes

Fixes #59080

* adjust test for stronger entity glob includes

* sync with docs
2022-06-28 11:42:51 -05:00
Erik Montnemery 26a85c6644
Add Entity.has_entity_name attribute (#73217) 2022-06-28 09:38:05 -07:00
J. Nick Koston 2225d0e899
Enable serialization of float subclasses with orjson (#74136) 2022-06-28 17:07:40 +02:00
[pʲɵs] 0e9164b082
Add bool template filter and function (#74068)
Co-authored-by: Erik <erik@montnemery.com>
2022-06-28 16:22:09 +02:00
J. Nick Koston 949922ef2c
Fix exception when as_dict is called on a TemplateState (#73984) 2022-06-25 09:19:11 -07:00
J. Nick Koston 32e0d9f47c
Speed up generation of template states (#73728)
* Speed up generation of template states

* tweak

* cache

* cache hash

* weaken

* Revert "weaken"

This reverts commit 4856f50080.

* lower cache size as it tends to be the same ones over and over

* lower cache size as it tends to be the same ones over and over

* lower cache size as it tends to be the same ones over and over

* cover

* Update homeassistant/helpers/template.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* id reuse is possible

* account for iterting all sensors

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-06-24 17:28:26 -04:00
J. Nick Koston edb386c736
Switch frontend to use json helper (#73874) 2022-06-23 20:19:13 +02:00
Franck Nijhof a8a033681f
Automatically onboard DiscoveryFlows (#73841) 2022-06-22 22:37:49 +02:00
Erik Montnemery 4435c641de
Enforce RegistryEntryHider in entity registry (#73219) 2022-06-08 12:36:43 -07:00
Erik Montnemery 921245a490
Remove deprecated temperature conversion of non sensors (#73222) 2022-06-08 20:47:47 +02:00
J. Nick Koston bc22e79c7b
Add a test for a complex entity filter (#73005) 2022-06-04 18:43:23 -07:00
Raphaël Beamonte 88129dbe91
Allow `log` template function to return specified `default` on math domain error (#72960)
Fix regression for logarithm template
2022-06-03 15:27:10 +02:00
Joakim Plate 8910d265d6
Keep track of a context for each listener (#72702)
* Remove async_remove_listener

This avoids the ambuigity as to what happens if same callback is added multiple times.

* Keep track of a context for each listener

This allow a update coordinator to adapt what data to request on update from the backing service based on which entities are enabled.

* Clone list before calling callbacks

The callbacks can end up unregistering and modifying the dict while iterating.

* Only yield actual values

* Add a test for update context

* Factor out iteration of _listeners to helper

* Verify context is passed to coordinator

* Switch to Any as type instead of object

* Remove function which use was dropped earliers

The use was removed in 8bee25c938
2022-06-03 13:55:57 +02:00
Paulus Schoutsen 6a3d2e54a2
Handle OAuth2 rejection (#72040) 2022-05-28 20:23:16 -07:00
Paulus Schoutsen d59258bd25
Revert "Add service entity context (#71558)" (#72610) 2022-05-27 10:30:40 -07:00
Kevin Stillhammer 90e5d69184
Add template as_timedelta (#71801) 2022-05-23 19:32:22 +02:00
Allen Porter 26ee289be3
Add return code to integration application credentials in config flow (#71986)
* Add return code to integration application credentials in config flow

* Update google tests to use new return code

* Update spotify test for no auth configured

* Add translation for oauth2_missing_credentials

* Add new return code to yolink

* Update homeassistant/strings.json

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

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-05-18 06:30:57 -07:00
epenet 4eb46d45ca
Cleanup deprecated async_get_registry in tests (#72059) 2022-05-18 13:12:38 +02:00
Franck Nijhof bfb47eb212
Final clean up of helpers accessed via hass (#72032)
* Final clean up of helpers accessed via hass

* Fix circular dep

* Fix import
2022-05-17 23:42:37 +03:00
Franck Nijhof c0da97b038
Clean up accessing service helpers via hass (#72013) 2022-05-17 10:56:57 -07:00
Franck Nijhof 8f4caf4141
Clean up accessing event helpers via hass (#72011) 2022-05-17 19:36:29 +02:00
J. Nick Koston a614ddca28
Support requesting translations for multiple integrations in a single request (#71979) 2022-05-17 01:23:11 -05:00
Paulus Schoutsen 3b88c6c012
Inverse parallel updates default check, follow sync "update" method (#71720) 2022-05-16 17:10:34 -07:00
Erik Montnemery 4885331509
Fail template functions when no default specified (#71687) 2022-05-13 09:46:49 -07:00
Paulus Schoutsen 64636a4310
Add service entity context (#71558)
Co-authored-by: Shay Levy <levyshay1@gmail.com>
2022-05-09 14:45:53 -07:00
J. Nick Koston 30fdfc454f
Avoid lowercasing entities after template ratelimit recovery (#71415) 2022-05-09 12:48:38 +02:00
Paulus Schoutsen e35a5a1a28
Fix other enums in helpers (#71505) 2022-05-07 20:57:48 -07:00
Paulus Schoutsen b1a04302b5
Stringify enums in selectors (#71441) 2022-05-06 11:25:01 -07:00
Paulus Schoutsen c8f95b7dfc
Ignore loading system entity category (#71361) 2022-05-05 14:33:37 -07:00
Paulus Schoutsen 353cc0b8c2
Fix importing blueprints (#71365)
Co-authored-by: Shay Levy <levyshay1@gmail.com>
2022-05-05 14:33:17 -07:00
Erik Montnemery eb10654e01
Add test for failing conditions in sub scripts (#71238) 2022-05-03 13:06:13 +02:00
Franck Nijhof 99360ad7f4
Indicate disabled steps in script trace (#71237) 2022-05-03 13:04:59 +02:00
Erik Montnemery 92f1855bcf
Fix script conditions (#71235) 2022-05-03 11:28:08 +02:00
Erik Montnemery 1931600eac
Isolate parallel subscripts (#71233) 2022-05-03 10:36:58 +02:00
Erik Montnemery 1aaf78ef99
Remove entity category system in favor of hidden_by (#68550) 2022-05-02 09:33:16 -07:00
Erik Montnemery f35e7d1129
Allow cancelling async_at_start helper (#71196) 2022-05-02 07:41:14 -07:00
Erik Montnemery f6c2fb088c
Stop script if sub-script stops or aborts (#71195) 2022-05-02 14:59:58 +02:00
Allen Porter 00b5d30e24
Add application credentials platform (#69148)
* Initial developer credentials scaffolding
- Support websocket list/add/delete
- Add developer credentials protocol from yaml config
- Handle OAuth credential registration and de-registration
- Tests for websocket and integration based registration

* Fix pydoc text

* Remove translations and update owners

* Update homeassistant/components/developer_credentials/__init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/developer_credentials/__init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Remove _async_get_developer_credential

* Rename to application credentials platform

* Fix race condition and add import support

* Increase code coverage (92%)

* Increase test coverage 93%

* Increase test coverage (94%)

* Increase test coverage (97%)

* Increase test covearge (98%)

* Increase test coverage (99%)

* Increase test coverage (100%)

* Remove http router frozen comment

* Remove auth domain override on import

* Remove debug statement

* Don't import the same client id multiple times

* Add auth dependency for local oauth implementation

* Revert older oauth2 changes from merge

* Update homeassistant/components/application_credentials/__init__.py

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

* Move config credential import to its own fixture

* Override the mock_application_credentials_integration fixture instead per test

* Update application credentials

* Add dictionary typing

* Use f-strings as per feedback

* Add additional structure needed for an MVP application credential

Add additional structure needed for an MVP, including a target
component Xbox

* Add websocket to list supported integrations for frontend selector

* Application credentials config

* Import xbox credentials

* Remove unnecessary async calls

* Update script/hassfest/application_credentials.py

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

* Update script/hassfest/application_credentials.py

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

* Update script/hassfest/application_credentials.py

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

* Update script/hassfest/application_credentials.py

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

* Import credentials with a fixed auth domain

Resolve an issue with compatibility of exisiting config entries when importing
client credentials

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-30 08:06:43 -07:00
Franck Nijhof 682ac52a20
Support shorthand logical operators in script sequences (#71022) 2022-04-29 18:06:21 +02:00
Erik Montnemery c5d69ab1b2
Handle removed entites in collection.sync_entity_lifecycle (#70759)
* Handle removed entites in collection.sync_entity_lifecycle

* Add comment
2022-04-27 08:05:00 -07:00
Paulus Schoutsen 5317bf02e6
Fix hidden default (#70699) 2022-04-25 10:10:42 -07:00
Erik Montnemery d045e8678d
Use recorder test fixtures in tests (#70652) 2022-04-25 14:23:52 +02:00
Dave T 70e125850c
Limit autogenerated entity_id string length (#69739) 2022-04-21 22:39:51 -07:00
Franck Nijhof 7b75a16745
Add visible by default property to base Entity (#70370) 2022-04-21 22:06:34 -07:00
Franck Nijhof 35687def02
Merge stop & error script actions (#70109) 2022-04-20 14:22:37 -07:00
Thomas Lovén b50f369fe4
Add shorthand notation for boolean conditions (#70120) 2022-04-18 22:09:09 +02:00
Franck Nijhof ce1f074ca9
Add Template selector (#70229) 2022-04-18 11:28:01 -07:00
J. Nick Koston 026e1635cc
Rename async_process_integration_platform to async_process_integration_platform_for_component (#70217) 2022-04-17 20:59:31 -10:00
J. Nick Koston b4ef150339
Add a guard when there are no integration platforms loaded (#70182) 2022-04-17 22:45:52 -07:00
J. Nick Koston 42c448c422
Add the ability to process integration platforms on demand (#70174) 2022-04-17 00:23:00 -10:00
Raman Gupta 3bcd921a28
Add entity registry helper to update entity platform (#69162)
* Add entity registry helper to migrate entity to new platform

* Add additional assertion

* Add more properties to migration logic

* Change logic after thinking about erik's comments

* Require new_config_entry_id if entry.config_entry_id is not None

* Create private async_update_entity function that all update functions use

* Don't have special handling for entity ID missing in async_update_entity_platform

* fix docstring
2022-04-16 16:18:52 -04:00
Franck Nijhof 1b48d7eda1
Add for each item support to repeat action (#70093) 2022-04-15 19:10:25 +02:00
Franck Nijhof e04fef3c2d
Allow disabling specific triggers/actions/conditions (#70082) 2022-04-15 09:33:09 -07:00
Franck Nijhof cdabcce83a
Add ability to continue scripts/automations on error (#70004) 2022-04-14 13:43:14 -07:00
Franck Nijhof d704d4f853
Add parallel automation/script actions (#69903) 2022-04-13 13:07:44 -07:00
Erik Montnemery a9742cc445
Drop frontend metadata from entity service schemas (#69894) 2022-04-12 18:09:06 +02:00
Franck Nijhof 67b200a532
Add if/else automation/script action (#69811)
Co-authored-by: Erik <erik@montnemery.com>
2022-04-12 15:02:17 +02:00
Franck Nijhof 81d90b1bc7
Add stop/error script/automation action (#67340) 2022-04-11 14:22:22 -07:00
Franck Nijhof 7087020283
Allow any entity to match state condition (#69763) 2022-04-11 10:53:42 -07:00
Franck Nijhof 6524dd8fb7
Add support for expanding zones in templates (#69793) 2022-04-11 12:59:45 +02:00
Raman Gupta b325c112b4
Add SelectorType enum and TypedDicts for each selector's data (#68399)
* rebase off current

* rearrange

* Overload selector function

* Update/fix all selector references

* better typing?

* remove extra option

* move things around

* Switch to Sequence type to avoid ignoring mypy error

* Get rid of ...'s

* Improve typing to reduce number of ignores

* Remove all typing ignores

* Make config optional for selectors that don't need a config

* add missing unit prefixes

* Rename TypedDicts

* Update homeassistant/helpers/selector.py

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

* review feedback

* remove peta from integration integration

* Fix min_max

* Revert change to selector function

* Fix logic

* Add typing for selector classes

* Update selector.py

* Fix indent

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-04-11 09:20:56 +02:00
J. Nick Koston fe6a4bfb1d
Remove EVENT_TIME_CHANGED and EVENT_TIMER_OUT_OF_SYNC (#69643)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-09 09:05:54 -10:00
Allen Porter c07100e519
Move Local OAuth http endpoint registration to auth component (#69507) 2022-04-06 22:34:31 -07:00
Franck Nijhof b369616aad
Remove deprecated YAML configuration from MJPEG Camera (#68980) 2022-04-04 17:57:48 +02:00
J. Nick Koston c2c6d12d73
Only fire device_registry_updated for suggested_area if the suggestion results in an area change (#69215) 2022-04-04 09:51:39 +02:00
epenet 4c7e1fe060
Cleanup ENTITY_CATEGORIES_SCHEMA (#66549)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-04-01 09:40:43 -07:00
Paulus Schoutsen 130ca2213f
Enforce EntityCategory enum (#69015)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-31 15:04:33 -07:00
Erik Montnemery 69ee4cd978
Deprecate temperature conversion in base entity class (#68978)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-03-31 14:29:44 -07:00
Paulus Schoutsen 5eb19b8a70
Enforce RegistryEntryDisabler enum (#69017)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-31 13:10:07 -07:00
Raman Gupta 6b2fe6cba9
Add support for new select selector properties (#68952)
* Add support for new select selector properties

* fix mode option

* Apply suggestions from code review

* Correct validation for empty options, update tests

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-03-31 11:28:49 +02:00
Erik Montnemery f9f360c64e
Rename helper_config_entry_flow to schema_config_entry_flow (#68924) 2022-03-30 14:36:47 -07:00
Paulus Schoutsen 206ea9d237
Expand group lights/covers etc (#68875)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-30 10:11:09 +02:00