Commit Graph

537 Commits

Author SHA1 Message Date
Ville Skyttä
05ddd773ff Fix _abort_if_unique_id_configured updates type hint (#68730) 2022-03-29 09:24:15 +02:00
Marc Mueller
911b159281 Cleanup after pylint update (#68657) 2022-03-26 00:34:12 +01:00
Marc Mueller
53245c6523 Update pylint to 2.13.0 (#68656) 2022-03-25 15:14:48 -07:00
Marc Mueller
ec980a574b Improve typing [util.decorator] (#67087) 2022-02-23 20:58:42 +01:00
Erik Montnemery
c496748125 Add WS API for removing a config entry from a device (#66188)
* Add WS API for removing a config entry from a device

* Address review comments

* Address review comments

* Remove entity cleanup from ConfigEntries

* Update + add tests

* Improve comments in test

* Add negative test

* Refactor according to review comments

* Add back async_remove_config_entry_device

* Remove unnecessary error handling

* Simplify error handling
2022-02-21 10:11:18 +01:00
Marc Mueller
8d2fb72cc3 Add type ignore error codes [core] (#66773) 2022-02-17 23:09:22 -08:00
J. Nick Koston
0ec89ae5da Teach _async_abort_entries_match about entry options (#66662) 2022-02-16 18:15:31 +01:00
Erik Montnemery
335a918118 Create MQTT discovery flow when manual config is present (#66248)
* Create MQTT discovery flow when manual config is present

* Change to integration_discovery flow

* Add test

* Add default handler for integration_discovery
2022-02-11 10:31:51 +01:00
Erik Montnemery
f5fff95e8b Tweak constant config_entries.DISCOVERY_SOURCES (#66249) 2022-02-10 11:12:38 +01:00
J. Nick Koston
ff59f1ee51 Add INTEGRATION_DISCOVERY to DISCOVERY_SOURCES (#65811) 2022-02-05 10:36:04 -06:00
epenet
494ef2f9b2 Adjust config_entry UpdateListenerType signature (#65410)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-02-02 09:56:34 -08:00
Franck Nijhof
9e33a3014c Automatically add entry title as name placeholder in reauth (#64078) 2022-01-18 14:18:16 -08:00
epenet
59c84f9586 Explicitly allow Mapping type hint in config entry async_update_entry (#63986)
* Allow MappingProxyType in async_update_entry

* Add setup type hints to ps4

* Adjust type hint to Mapping

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-14 04:06:19 +01:00
Marc Mueller
12757a8cd2 Update typing - collections.abc (1) (#63933)
* Update typing - collections.abc (1)

* Additional typing updates
2022-01-12 07:56:35 +01:00
Franck Nijhof
f4aa18de31 Replace hass.helpers: async_call_later() (#63929) 2022-01-11 13:30:59 -08:00
Erik Montnemery
8d6e2ae354 Import persistent notification part 1 (#63898) 2022-01-11 17:24:59 +01:00
epenet
34a967c48a Explicitely allow Platform enum in config_entries (#63581)
* Explicitely allow Platform enum in config_entries

* Undo argument name change and conversion to string

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-09 06:08:04 +01:00
Marc Mueller
b0f72f59da Use imports from core (#63458) 2022-01-05 14:55:38 +01:00
Tobias Sauerwein
2c904c0974 Bump mypy to 0.930 (#62642)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2021-12-27 17:55:17 +01:00
Ruslan Sayfutdinov
55f4962c06 Fix pylint plugin which checks relative imports (#62693) 2021-12-23 11:14:47 -08:00
Ville Skyttä
5bf67cac66 Use RegistryEntryDisabler (#60436) 2021-12-15 23:25:40 +02:00
Ville Skyttä
7db3246de4 Make config entry disabled_by an enum (#60445)
* Make config entry disabled_by an enum

* Update homeassistant/config_entries.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-12-15 20:53:21 +01:00
Marcel van der Veldt
7c7df5bb51 Change check for existence of options flow (#61147)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-12-07 12:50:34 -08:00
epenet
b65b25c1bb Move MqttServiceInfo to init.py (#60905)
Co-authored-by: epenet <epenet@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-12-03 19:34:48 +01:00
epenet
358922db56 Use dataclass for HassioServiceInfo (#60824)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-03 14:05:56 +01:00
epenet
ec1c52d945 Use dataclass for SsdpServiceInfo (#59931)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-29 06:10:07 -10:00
epenet
75057949d1 Adjust async_step_discovery methods for BaseServiceInfo (#60285)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-24 19:30:02 -06:00
epenet
0dcfd55c84 Adjust async_step_usb signature for strict typing (#59773)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-16 19:03:50 +01:00
epenet
4387bbfb94 Adjust async_step_mqtt signature for strict typing (#59761)
* Add MqttServiceInfo

* Adjust async_step_mqtt signature

* Adjust async_step_mqtt signature

* Adjust components

Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-16 13:30:38 +01:00
epenet
476a59d248 Adjust async_step_dhcp signature for strict typing (#59751)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-16 12:19:50 +01:00
epenet
4d96ca3ddb Adjust async_step_homekit signature for strict typing (#59745)
* Use ZeroconfServiceInfo in async_step_homekit

* Update DiscoveryFlowHandler

* Update components
2021-11-15 17:27:04 -06:00
epenet
b3ffc1e183 Adjust async_step_zeroconf signature for strict typing (#59503)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-15 18:05:45 +01:00
J. Nick Koston
3b7dce8b95 Index in-progress flows to avoid linear search (#58146)
Co-authored-by: Steven Looman <steven.looman@gmail.com>
2021-10-22 07:19:49 -10:00
Marc Mueller
7af67d34cf Use assignment expressions 01 (#56394) 2021-09-18 13:31:35 -10:00
J. Nick Koston
e880f1c8f9 Index config entries by domain (#56316) 2021-09-17 10:39:00 -10:00
J. Nick Koston
e92e206544 Fix race that allowed multiple config flows with the same unique id (#55131)
- If a config flow set a unique id and then did an await to
  return control to the event loop, another discovery with
  the same unique id could start and it would not see
  the first one because it was still uninitialized. We now
  check uninitialized flows when setting the unique id
2021-08-23 23:01:21 -05:00
J. Nick Koston
dc74a52f58 Add support for USB discovery (#54904)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-20 14:04:18 -05:00
J. Nick Koston
725b316ec6 Add HomeKit and DHCP to DISCOVERY_SOURCES in config_entries (#54923) 2021-08-20 17:02:03 +02:00
Ville Skyttä
848c0be58a Avoid some implicit generic Anys (#54577) 2021-08-16 23:12:06 +02:00
Ville Skyttä
470f2dd73f Upgrade pyupgrade to 2.21.2, apply its changes (#52987) 2021-07-19 10:46:09 +02:00
Franck Nijhof
b91b553ce5 Abort existing reauth flow on entry removal (#52407) 2021-07-02 20:56:51 +02:00
Erik Montnemery
1d9d9021de Do not attempt to unload non loaded config entries (#51356) 2021-06-02 10:00:24 +02:00
Paulus Schoutsen
ee2c950716 Merge system options into pref properties (#51347)
* Make system options future proof

* Update tests

* Add types
2021-06-01 22:34:31 +02:00
Paulus Schoutsen
4821484d2c Add system option to disable polling (#51299) 2021-05-31 15:36:40 -07:00
Franck Nijhof
a8a13da793 Fix discovery without uid aborts on completing user flow (#51105)
* Fix discovery without uid aborts on completing user flow

* Fix comment
2021-05-26 16:29:52 +02:00
Ville Skyttä
19d25cd901 Change config entry state to an enum (#49654)
* Change config entry state to an enum

* Allow but deprecate EntryState str equality comparison

* Test fixes

* Rename to ConfigEntryState

* Remove str comparability backcompat

* Update new occurrences of strs cropped up during review
2021-05-20 19:19:20 +02:00
Ruslan Sayfutdinov
391b2f8ccd Add missing return type in Core constructors (#50884) 2021-05-20 18:53:29 +03:00
J. Nick Koston
34c84a6bbb Reduce boilerplate to abort for matching config entries (#50186)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-05-11 22:00:12 +02:00
Franck Nijhof
177317a345 Allow passing options in config flow entry creation (#49912) 2021-05-05 22:14:01 -07:00
Franck Nijhof
96f69fb9fb Finalize clean up connection classes (#49895) 2021-05-04 20:08:51 +02:00