Commit Graph

108 Commits (aac0180abf9c1c0e21d519b726654e378801149b)

Author SHA1 Message Date
Shay Levy ab73ce00a0
Change "Not adding entity" log level to debug (#52240) 2021-06-28 11:22:10 +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
Ruslan Sayfutdinov 391b2f8ccd
Add missing return type in Core constructors (#50884) 2021-05-20 18:53:29 +03:00
Ruslan Sayfutdinov 0cb08f9516
Add missing type hints in entity_platform (#50453) 2021-05-12 16:28:44 +02:00
Franck Nijhof efb1bb08a4
Add small async_get_current_platform helper method (#50014) 2021-05-03 16:46:42 +02:00
Franck Nijhof 378cee01b4
Add typing to async_register_entity_service (#50015) 2021-05-03 14:22:38 +02:00
Ruslan Sayfutdinov 0301706fc6
Define AddEntitiesCallback type (#49812) 2021-04-29 12:28:14 +02:00
J. Nick Koston 3fa8ffa731
Enable mccabe complexity checks in flake8 (#49616)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-25 12:38:40 +02:00
Marc Mueller c07646db5d
Update typing syntax (#49480)
* Update typing syntax

* Replace typing imports with ones from collections where possible

* Changes after review
2021-04-20 17:40:41 +02:00
J. Nick Koston 44beff31c2
Cancel config entry retry, platform retry, and polling at the stop event (#49138) 2021-04-13 16:16:26 -10:00
Raman Gupta 769923e8dd
Raise exception for invalid call to DeviceRegistry.async_get_or_create (#49038)
* 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 4cd7f9bd8b
Raise ConfigEntryAuthFailed during setup or coordinator update to start reauth (#48962) 2021-04-09 19:41:29 -10:00
J. Nick Koston 12e3bc8101
Provide api to see which integrations are being loaded (#48274)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-04-04 22:11:44 -10:00
J. Nick Koston b5c679f3d0
Apply ConfigEntryNotReady improvements to PlatformNotReady (#48665)
* Apply ConfigEntryNotReady improvements to PlatformNotReady

- Limit log spam #47201
- Log exception reason #48449
- Prevent startup blockage #48660

* coverage
2021-04-04 12:31:58 +02:00
Franck Nijhof 38d14702fa
Remove HomeAssistantType alias from helpers (#48400) 2021-03-27 12:55:24 +01:00
J. Nick Koston c4f98a3084
Small speed up to adding entities (#48353) 2021-03-26 12:05:19 +01:00
Marc Mueller 6fb2e63e49
Update typing 02 (#48014) 2021-03-17 18:34:19 +01: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
J. Nick Koston bb7e4d7daa
Implement suggested_area in the device registry (#45940)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-02-19 19:34:33 -10: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
Paulus Schoutsen 9e07910ab0
Mark entities as unavailable when they are removed but are still registered (#45528)
* Mark entities as unavailable when they are removed but are still registered

* Add sync_entity_lifecycle to collection helper

* Remove debug print

* Lint

* Fix tests

* Fix tests

* Update zha

* Update zone

* Fix tests

* Update hyperion

* Update rfxtrx

* Fix tests

* Pass force_remove=True from integrations

Co-authored-by: Erik <erik@montnemery.com>
2021-02-08 10:45:46 +01:00
Ville Skyttä 3a88a4120e
Helpers type hint improvements (#44964) 2021-01-09 00:08:34 +01:00
Philip Allgaier 392c058d34
Ensure consistent spelling of "ID" (#44585) 2020-12-28 18:34:08 +01:00
J. Nick Koston 3ec7258c21
Ensure instances of async_add_entities can be garbage collected (#42919) 2020-11-07 06:54:20 -10:00
J. Nick Koston ce2c388c09
Ensure config entry platforms are excluded from reload (#42367) 2020-10-25 23:53:31 +01:00
J. Nick Koston df2ede6522
Fix state overwrite race condition where two platforms request the same entity_id (#42151)
* Fix state overwrite race condition where two platforms request the same entity id

* fix test

* create reservations instead

* revert

* cannot use __slots__ because we patch async_all
2020-10-21 17:01:51 +02:00
Erik Montnemery 12a6d10168
Log exceptions in EntityPlatform.async_add_entities (#41730)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-13 15:35:27 +02:00
Ville Skyttä f28c3273c2
Upgrade mypy to 0.790 (#41595) 2020-10-12 19:17:30 -05:00
Ville Skyttä 167490b71c
Complete helpers.service type hints (#40193)
* Complete helpers.service type hints

* Update homeassistant/helpers/service.py

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

* Handle None entity.supported_features
2020-09-20 12:03:58 +03:00
J. Nick Koston 8adfcf23f0
Fix isy994 send_node_command (#39806) 2020-09-08 17:31:08 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Paulus Schoutsen 3dc79aa60a
Track entity sources (#37258)
Co-authored-by: David Mulcahey <david.mulcahey@me.com>
2020-08-19 14:57:38 +02:00
J. Nick Koston af5cb948a0
Adjust slow add entities timeouts to handle slowest known case (#38876)
With this change, we should still be able to startup
in under 10 minutes if something really goes wrong.

The testing done in #38661 was used to determine
these values.
2020-08-15 07:14:02 +02:00
Paulus Schoutsen b3571602bb
Add default_* to device registry (#38829) 2020-08-13 10:38:56 +02:00
Ville Skyttä 991bf126d4
Helpers type hint improvements (#38522) 2020-08-12 23:01:10 +02:00
Pascal Vizeli 72a6251042
V2 timeout for async_add_entities (#38601)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-08-07 08:36:38 +02:00
Pascal Vizeli 896bdbff8f
Revert "Add a timeout for async_add_entities (#38474)" (#38584)
This reverts commit 7590af3930.
2020-08-06 09:32:42 +02:00
J. Nick Koston 7590af3930
Add a timeout for async_add_entities (#38474) 2020-08-05 18:06:21 +02:00
Pascal Vizeli c291d4aa7d
Intelligent timeout handler for setup/bootstrap (#38329)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-05 14:58:19 +02:00
J. Nick Koston fe69a85386
Improve logging when a unique id conflict is detected (#38434)
* fix error when unique id is re-used

* add test for the logging

* Update homeassistant/helpers/entity_platform.py

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

* Update homeassistant/helpers/entity_platform.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-08-01 11:20:37 +02:00
David F. Mulcahey 967a168ab7
Update comment about parallel updates to match the documentation (#37964) 2020-07-19 14:40:08 -10:00
Paulus Schoutsen d08d00daa7
Limit entity platform entity service to same integration (#37313) 2020-07-02 11:39:53 +02:00
mdegat01 52f3238e17
Add constant for PlatformNotReady wait time to use in tests (#37266) 2020-07-01 08:42:57 -07:00
Paulus Schoutsen 1ffa8fcbba
Platforms cleanup when adding entity fails (#36742) 2020-06-12 17:54:46 -07:00
Ville Skyttä 0c5ca3084e
Add and fix type hints (#36501)
* Fix exceptions.Unauthorized.permission type

* Use auth.permission consts more

* Auth typing improvements

* Helpers typing improvements

* Calculate self.state only once
2020-06-06 20:34:56 +02:00
Paulus Schoutsen 276f3afb00
Do async_setup_platform in background (#36244)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-31 22:18:30 -07:00
Paulus Schoutsen b90cb09fd1
Add type to device registry (#35095) 2020-05-03 13:56:58 -07:00
Paulus Schoutsen 5a9970e63c
Dump states in event handler for HA_Stop (#33974)
* Dump states in event handler for HA_Stop

* Fix type
2020-04-13 17:41:01 -07:00
Paulus Schoutsen aef06a3544
Directly call write state 2 (#33513)
* Directly call async_write_ha_state pt2

* Directly call async_write_ha_state pt2

* Fix mock

* Address comments
2020-04-03 09:34:50 +02:00