Commit Graph

524 Commits

Author SHA1 Message Date
Franck Nijhof
f0e5e616a7 Fix device discovery of OAuth2 config flows (#48326) 2021-03-25 10:35:01 -07:00
J. Nick Koston
f35641ae8e Make sure include_ignore=False always works with _async_current_entries (#48196)
If the step was anything other than SOURCE_USER,
include_ignore=False would not be honored
2021-03-21 21:57:49 -07:00
J. Nick Koston
3f2ca16ad7 Index config entries by id (#48199) 2021-03-21 21:44:29 -07:00
Marc Mueller
4cb7718192 Update typing 16 (#48087) 2021-03-18 22:58:19 +01:00
Marc Mueller
e55702d635 Update typing 01 (#48013) 2021-03-17 17:34:55 +01:00
Paulus Schoutsen
67effbc8c4 Config flow to allow marking itself as confirm only (#47607) 2021-03-08 10:54:51 -08:00
Erik Montnemery
504e5b77ca Improve behaviour when disabling or enabling config entries (#47301) 2021-03-03 10:12:37 -08:00
Simone Chemelli
17444e2f2f Limit log spam by ConfigEntryNotReady (#47201) 2021-03-02 12:50:28 -08:00
Ville Skyttä
dc880118a4 Lint suppression cleanups (#47248)
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
Erik Montnemery
003fee2a35 Fix race when disabling config entries (#47210)
* Fix race when disabling config entries

* Remove unused constant
2021-03-01 12:38:49 +01:00
Erik Montnemery
5e26bda52d Add support for disabling config entries (#46779) 2021-02-20 19:21:39 -08:00
J. Nick Koston
c9df42b69a Add support for pre-filtering events to the event bus (#46371) 2021-02-14 09:42:55 -10:00
Franck Nijhof
bc1daf1802 None optional hass typing in FlowHandler (#46462)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-13 13:21:37 +01:00
Franck Nijhof
9b7c39d20b Postponed evaluation of annotations in core (#46434)
* Postponed evaluation of annotations in core

* Remove unneeded future
2021-02-12 10:58:20 +01:00
Erik Montnemery
dd150bb797 Allow manual configuration of ignored singleton config entries (#45161)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-02-04 11:08:10 +01:00
jpcornil-git
74a44e03fa Extend add_update_listener support to bound methods (#44238) 2021-01-26 22:19:10 +01:00
Simone Chemelli
86cd7911de Clarify ConfigEntryNotReady log (#45425)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Charles Garwood <cgarwood@gmail.com>
2021-01-22 12:13:23 -05:00
J. Nick Koston
da677f7d5a Add support for discovery via DHCP (#45087)
* Add support for discovery via DHCP

* additional tesla ouis

* merge tests

* dhcp test

* merge requirements test

* dhcp test

* dhcp discovery

* dhcp discovery

* pylint

* pylint

* pylint

* fix

* Add matching tests

* 100% cover

* cleanup

* fix codespell

* Update exception handling

* remove unneeded comment

* fix options handling exception

* fix options handling exception
2021-01-14 09:09:08 +01:00
Paulus Schoutsen
e83ced6737 Add name to ignored entries (#45051)
* Add name to ignored entries

* Fix test
2021-01-12 09:26:20 +01:00
Ville Skyttä
317ed418dd Use singleton enum for "not set" sentinels (#41990)
* Use singleton enum for "not set" sentinel

https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions

* Remove unused variable
2020-12-19 12:46:27 +01:00
nivnoach
906e1ce960 Allow manual configuration of ignored config entries (#43947) 2020-12-07 09:25:04 +01:00
Erik Montnemery
5694e4190c Extend WS API result when enabling an entity (#42667)
* Extend WS API result when enabling an entity

* Fix tests

* Fix tests

* Move updated registry entry to sub dict

* Address review comments

* Increase test coverage
2020-11-09 19:47:45 +01:00
Raman Gupta
a416a9e046 Allow options flows to be aborted (#41875) 2020-11-09 08:59:42 +01:00
Philip Allgaier
bd1d6f2c0d Add link to log view in persistent notification (#42060) 2020-10-21 12:09:45 -05:00
Raman Gupta
0e20bba40a Add persistent notification for reauth config flows (#41811)
* add persistent notification for reauth config flow

* remove log

* Update homeassistant/config_entries.py

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

* Update homeassistant/config_entries.py

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

* fix logic for determining when to dismiss notification

* add comment

* improve tests to ensure notifications only get dismissed when all in progress config flows of a given type are complete

* Update homeassistant/config_entries.py

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

* handle context is None when accessing source

* add guard to show_advanced_options

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-10-15 15:46:27 -05:00
Erik Montnemery
a3f8b76537 Make async_step_discovery default for MQTT config flows (#41414) 2020-10-07 23:49:29 +02:00
Erik Montnemery
343e5d64b8 Add MQTT integration discovery (#41332)
* Add MQTT integration discovery

* Add script/hassfest/mqtt.py

* Unsubscribe if config entry exists

* Add homeassistant/generated/mqtt.py

* Fix bad loop

* Improve tests

* Improve tests

* Apply suggestions from code review

Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>

* Prevent initiating multiple config flows

Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
2020-10-07 18:30:51 +02:00
J. Nick Koston
8d5c124deb Improve performance of generating non-cryptographically secure uuids (#41314) 2020-10-07 16:37:01 +02:00
Chris Talkington
37e51aa166 Add reauth source constant for config entries (#40352) 2020-09-20 21:15:48 -05:00
Ville Skyttä
1bf2c4d976 Upgrade pylint to 2.6.0 (#39363) 2020-08-29 07:59:24 +02:00
Ville Skyttä
b4bac0f7a0 Exception chaining and wrapping improvements (#39320)
* Remove unnecessary exception re-wraps

* Preserve exception chains on re-raise

We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.

The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.

Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.

* Fix mistaken re-wrap in homematicip_cloud/hap.py

Missed the difference between HmipConnectionError and
HmipcConnectionError.

* Do not hide original error on plex new cert validation error

Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
2020-08-28 13:50:32 +02:00
Franck Nijhof
1c2ebdf307 Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
J. Nick Koston
e109b04efe Add api to reload config entries (#39068) 2020-08-26 00:59:22 +02:00
J. Nick Koston
bee6d87e7a Standardize uuid generation for events/storage/registry (#39184) 2020-08-24 17:21:30 +02:00
Paulus Schoutsen
71acb2c665 Only reload config entry if it is loaded (#39202) 2020-08-24 10:54:26 +02:00
J. Nick Koston
74c23c3e96 Add support for reload_on_update to _abort_if_unique_id_configured (#38638)
* Add support for reload_on_update to _abort_if_unique_id_configured

async_update_entry now avoids firing update listeners and writing
the storage if there are no actual changes.

* Actually add the tests

* collapse branch

* Update homeassistant/config_entries.py

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

* handle entries that lack the ability to reload

* reduce

* adjust konnected tests

* update axis tests

* fix blocking

* more mocking

* config flow tests outside of test_config_flow

* reduce

* volumio

* Update homeassistant/config_entries.py

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

* set reload_on_update=False for integrations that implement self._abort_if_unique_id_configured(updates= and a reload listen

* get rid of copy

* revert test change

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-08-08 13:23:56 -05:00
Ville Skyttä
aa1c5fc43d Various type hint improvements (#37952) 2020-07-22 08:06:37 -07:00
Ville Skyttä
ac0dbb17af Attrs cleanups (#37849) 2020-07-14 10:30:30 -07:00
Franck Nijhof
53545c984b Log lines do not end with a full stop (#37527) 2020-07-05 23:04:19 +02:00
Erik Montnemery
747490ab34 Support reconfiguring MQTT config entry (#36537) 2020-06-22 17:49:01 -07:00
Franck Nijhof
3cc94f7d6a ConfigFlow default discovery without unique ID (#36754) 2020-06-15 13:38:38 +02:00
J. Nick Koston
d2a92ce4f3 Ensure a deleted integration can be removed (#36130)
* Ensure a deleted intergration can be removed

* Update homeassistant/config_entries.py

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

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-05-25 15:40:06 -04:00
jjlawren
c12f8bed43 Plex discovery on demand (#35303)
* Allow Plex discovery on demand

* Add new discovery source

* Add tests
2020-05-13 09:11:00 -04:00
Ville Skyttä
b4404b071f Pylint cleanups (#35409)
* Avoid some outer name redefinitions

* Remove unneeded directives

* Narrow directive scope

* Don't disable redefined-variable-type
2020-05-09 14:08:40 +03:00
Franck Nijhof
98a2efcbab Collection of random (mainly) test improvements (#33733) 2020-04-06 12:51:48 +02:00
Franck Nijhof
7d3c974747 Use set & dict literals (#33636)
Co-authored-by: Daniel Høyer Iversen <mail@dahoiv.net>
2020-04-04 20:05:15 +02:00
Paulus Schoutsen
d4615fd432 Freeze config entry data (#32615)
* Freeze config entry data

* Fix mutating entry.data

* Fix config entry options tests
2020-03-09 14:07:50 -07:00
Paulus Schoutsen
e019280d94 Annotate more async functions correctly (#31802) 2020-02-14 10:00:22 -08:00
Franck Nijhof
0173c61fee Spelling: Config(uration) (#31782) 2020-02-13 08:27:00 -08:00
Christian Clauss
df7d2b3aeb Fix typos found by codespell (#31243)
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00