Commit graph

86 commits

Author SHA1 Message Date
epenet
6febe00516
Fix lingering task in entity_platform test ()
* Fix lingering task in entity_platform test

* Speed up the test
2023-03-01 10:49:13 +01:00
epenet
5f25b71df7
Add type hints to core tests () 2023-02-20 11:42:56 +01:00
Franck Nijhof
1e05697080
Enable Ruff B007 ()
* Enable Ruff B007

* Adjust existing cases
2023-02-17 21:08:18 -05:00
Franck Nijhof
ed79265843
Enable Ruff PT006 ()
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Franck Nijhof
80bf632e2d
Clean up unnecessary registry mocks from helpers () 2023-02-08 20:15:29 -05:00
epenet
c98b4e3204
Add typing to tests with single hass argument (2) ()
* Add typing to tests with single hass argument (2)

* a few more
2023-02-08 08:51:43 +01:00
Erik Montnemery
8e617bbc1d
Add translation_key property to entites ()
* 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
Erik Montnemery
e332091d76
Improve unique_id collision checks in entity_platform () 2022-09-09 14:35:23 +02:00
Erik Montnemery
2e228b2608
Tweak handling of entities with has_entity_name set ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-07-11 15:10:53 -07:00
Erik Montnemery
26a85c6644
Add Entity.has_entity_name attribute () 2022-06-28 09:38:05 -07:00
Paulus Schoutsen
3b88c6c012
Inverse parallel updates default check, follow sync "update" method () 2022-05-16 17:10:34 -07:00
Franck Nijhof
7b75a16745
Add visible by default property to base Entity () 2022-04-21 22:06:34 -07:00
Paulus Schoutsen
130ca2213f
Enforce EntityCategory enum ()
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-31 15:04:33 -07:00
J. Nick Koston
a75bbc79a2
Prevent polling from recreating an entity after removal () 2022-03-07 20:42:16 -08:00
J. Nick Koston
a40549c1b9
Fix hw_version not updating from an entity device_info () 2021-12-18 21:53:49 -08:00
Ville Skyttä
5bf67cac66
Use RegistryEntryDisabler () 2021-12-15 23:25:40 +02:00
Joakim Plate
c54ca7941f
Make sure entity inherit disabled device () 2021-12-01 13:59:57 -08:00
Erik Montnemery
c0d2a66609
Add stable ID to entity registry entries ()
* Add UUID to entity registry entries

* Fix test
2021-11-24 09:01:35 +01:00
Ville Skyttä
39691faccc
Use DeviceEntryType in non-typechecked code too () 2021-11-23 10:04:33 +01:00
Erik Montnemery
49a27e12ad
Add support to entity registry for overriding device_class () 2021-11-22 08:38:06 -08:00
Erik Montnemery
0df2904b89
Improve some entity registry tests () 2021-11-22 10:24:37 +01:00
Jesse Hills
ea028e38d5
Allow configuration_url to be removed/nullified from device registry ()
* Allow configuration_url to be removed from device registry

* Add test

* Check for None before stringifying and url parsing

* Add type to dict to remove mypy error on assigning None
2021-10-28 12:11:54 +02:00
Joakim Sørensen
d16304a201
Allow homeassistant prefix for device info configuration url ()
* Allow panel prefix for device info configuration url

* Add to add-ons

* Use homeassistant as the prefix

* Update homeassistant/components/hassio/__init__.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-10-26 10:34:02 +02:00
Erik Montnemery
e27e4c3561
Add support for device configuration URL ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-10-14 11:16:56 -07: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
Franck Nijhof
c5383219f1
Remove stale debug statements from tests () 2021-05-25 11:52:20 +02:00
Ville Skyttä
77d5244577
Use device registry CONNECTION_* constants () 2021-04-30 23:58:50 +02:00
Ville Skyttä
a396619251
Use disabled_by constants ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-04-23 09:56:42 +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
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
Erik Montnemery
b3fecb1c95
Update tests t-z to use async_get() instead of async_get_registry() () 2021-03-09 14:25:03 +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
Ville Skyttä
2fb3be50ab
Make DeviceRegistry.async_get_device connections arg optional ()
* Make async_get_device connections Optional, default None

* Remove unnecessary async_get_device connections arg usages

Some of these were using an incorrect collection type, which didn't
cause issues mostly just due to luck.
2021-01-07 13:49:45 +01:00
Franck Nijhof
65cf2fcb6f
Drop asynctest () 2021-01-01 22:31:56 +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
springstan
d2b1918e9c
Drop UNIT_ prefix for percentage constant () 2020-09-05 21:09:14 +02:00
Paulus Schoutsen
b3571602bb
Add default_* to device registry () 2020-08-13 10:38:56 +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
J. Nick Koston
a7459b3126
Log which task is blocking startup when debug logging is on ()
* Log which task is blocking startup when debug logging for homeassistant.core is on

* test needs to go one level deeper now
2020-07-23 20:03:42 -06:00
Paulus Schoutsen
d08d00daa7
Limit entity platform entity service to same integration () 2020-07-02 11:39:53 +02:00
Paulus Schoutsen
1ffa8fcbba
Platforms cleanup when adding entity fails () 2020-06-12 17:54:46 -07:00
Paulus Schoutsen
276f3afb00
Do async_setup_platform in background ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-31 22:18:30 -07:00
J. Nick Koston
f626129e2b
Proceed with startup if an integration setup blocks for more than 30m ()
* Proceed with startup if an integration setup blocks for more than 30m

* Fix test location

* Fix log call

* naming

* revert

* do not shield from cancelation

* Adjust test since we now cancel when we hit the timeout
2020-05-27 13:43:05 -05:00
Paulus Schoutsen
b90cb09fd1
Add type to device registry () 2020-05-03 13:56:58 -07:00
Paulus Schoutsen
ec47216388
Use built-in test helpers on 3.8 () 2020-04-30 13:29:50 -07:00