Commit graph

113 commits

Author SHA1 Message Date
Robert Hillis
488a636aec
Clean up unused loggers () 2021-10-14 10:03:38 -07:00
Erik Montnemery
4b3d423767
Add config and diagnostic entities ()
* Add config entity concept

* Rename is_config_entity to entity_category

* Add test

* Add 'diagnostic' entity category
2021-10-14 10:04:26 +02:00
Erik Montnemery
bdbedd0f06
Alphabetize parts of device registry code () 2021-10-12 12:08:59 +02:00
Marc Mueller
77ee72cbb9
Import Callable from collections.abc (1) () 2021-09-29 16:32:11 +02:00
Marc Mueller
5d2e5d2612
Import Protocol from typing () 2021-07-12 10:35:17 +02:00
Shay Levy
ab73ce00a0
Change "Not adding entity" log level to debug () 2021-06-28 11:22:10 +02: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
Paulus Schoutsen
4821484d2c
Add system option to disable polling () 2021-05-31 15:36:40 -07:00
Ruslan Sayfutdinov
391b2f8ccd
Add missing return type in Core constructors () 2021-05-20 18:53:29 +03:00
Ruslan Sayfutdinov
0cb08f9516
Add missing type hints in entity_platform () 2021-05-12 16:28:44 +02:00
Franck Nijhof
efb1bb08a4
Add small async_get_current_platform helper method () 2021-05-03 16:46:42 +02:00
Franck Nijhof
378cee01b4
Add typing to async_register_entity_service () 2021-05-03 14:22:38 +02:00
Ruslan Sayfutdinov
0301706fc6
Define AddEntitiesCallback type () 2021-04-29 12:28:14 +02:00
J. Nick Koston
3fa8ffa731
Enable mccabe complexity checks in flake8 ()
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-25 12:38:40 +02:00
Marc Mueller
c07646db5d
Update typing syntax ()
* 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 () 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
4cd7f9bd8b
Raise ConfigEntryAuthFailed during setup or coordinator update to start reauth () 2021-04-09 19:41:29 -10:00
J. Nick Koston
12e3bc8101
Provide api to see which integrations are being loaded ()
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 ()
* Apply ConfigEntryNotReady improvements to PlatformNotReady

- Limit log spam 
- Log exception reason 
- Prevent startup blockage 

* coverage
2021-04-04 12:31:58 +02:00
Franck Nijhof
38d14702fa
Remove HomeAssistantType alias from helpers () 2021-03-27 12:55:24 +01:00
J. Nick Koston
c4f98a3084
Small speed up to adding entities () 2021-03-26 12:05:19 +01:00
Marc Mueller
6fb2e63e49
Update typing 02 () 2021-03-17 18:34:19 +01:00
Ville Skyttä
dc880118a4
Lint suppression cleanups ()
* 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 ()
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 ()
* 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 ()
* 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 () 2021-01-09 00:08:34 +01:00
Philip Allgaier
392c058d34
Ensure consistent spelling of "ID" () 2020-12-28 18:34:08 +01:00
J. Nick Koston
3ec7258c21
Ensure instances of async_add_entities can be garbage collected () 2020-11-07 06:54:20 -10:00
J. Nick Koston
ce2c388c09
Ensure config entry platforms are excluded from reload () 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 ()
* 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 ()
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 () 2020-10-12 19:17:30 -05:00
Ville Skyttä
167490b71c
Complete helpers.service type hints ()
* 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 () 2020-09-08 17:31:08 +02:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 () 2020-08-27 13:56:20 +02:00
Paulus Schoutsen
3dc79aa60a
Track entity sources ()
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 ()
With this change, we should still be able to startup
in under 10 minutes if something really goes wrong.

The testing done in  was used to determine
these values.
2020-08-15 07:14:02 +02:00
Paulus Schoutsen
b3571602bb
Add default_* to device registry () 2020-08-13 10:38:56 +02:00
Ville Skyttä
991bf126d4
Helpers type hint improvements () 2020-08-12 23:01:10 +02:00
Pascal Vizeli
72a6251042
V2 timeout for async_add_entities ()
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 ()" ()
This reverts commit 7590af3930.
2020-08-06 09:32:42 +02:00
J. Nick Koston
7590af3930
Add a timeout for async_add_entities () 2020-08-05 18:06:21 +02:00
Pascal Vizeli
c291d4aa7d
Intelligent timeout handler for setup/bootstrap ()
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 ()
* 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 () 2020-07-19 14:40:08 -10:00
Paulus Schoutsen
d08d00daa7
Limit entity platform entity service to same integration () 2020-07-02 11:39:53 +02:00
mdegat01
52f3238e17
Add constant for PlatformNotReady wait time to use in tests () 2020-07-01 08:42:57 -07:00
Paulus Schoutsen
1ffa8fcbba
Platforms cleanup when adding entity fails () 2020-06-12 17:54:46 -07:00