Commit Graph

84 Commits (076faaa4a4f231eb5b7b7c72fa20c239c7cc391c)

Author SHA1 Message Date
Stefan Agner 42706f780c
Convert disabled_by to DeviceEntryDisabler on load (#63944)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-01-11 20:50:32 -08:00
Paulus Schoutsen 2b4bb49eb7
Make device tracker entities work better (#63328)
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-04 23:16:43 -08:00
Ville Skyttä 5231bc5dcb
Simplify device registry update (#62868) 2022-01-04 15:02:11 +01:00
Ruslan Sayfutdinov 55f4962c06
Fix pylint plugin which checks relative imports (#62693) 2021-12-23 11:14:47 -08:00
J. Nick Koston 04153c0075
Add hardware version to the device registry (#61650) 2021-12-16 05:16:19 -06:00
Paulus Schoutsen a59ec9ca5e
Handle invalid device registry entry type (#60966)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-12-04 09:20:12 +01:00
Marvin Wichmann 707fe67c00
Move StrEnum to homeassistant.backports and move Platform to homeassistant.const (#60880)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-12-03 09:31:17 +01:00
Ville Skyttä e5718ccac4
Add removal versions and backcompat constants for device registry enum changes (#60421) 2021-11-29 09:47:14 +01:00
Ville Skyttä 9f4de8df18
Make device entry disabled by an enum (#60239) 2021-11-24 22:32:16 +01:00
Erik Montnemery 24779dea3b
Bump device registry version to 1.2 (#60199) 2021-11-23 22:22:15 +01:00
Erik Montnemery ca20fc857f
Remove via_device links when a device is removed (#60153)
* Remove via_device links when a device is removed

* Update test
2021-11-23 09:36:03 +01:00
Ville Skyttä 053c456199
Change device entry type to an StrEnum (#59940)
Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-11-22 18:14:15 +01:00
J. Nick Koston 96f7b0d910
Use atomicwrites for mission critical core files (#59606) 2021-11-15 11:19:31 +01:00
Erik Montnemery e27e4c3561
Add support for device configuration URL (#57539)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-10-14 11:16:56 -07:00
Erik Montnemery bdbedd0f06
Alphabetize parts of device registry code (#57532) 2021-10-12 12:08:59 +02:00
J. Nick Koston f74291ccb6
Expose the ability to move an entity/device between config entries (#56661) 2021-09-26 09:50:57 -07:00
Robert Svensson c6213b36ad
Only disable a device if all associated config entries are disabled (#53681) 2021-07-29 12:08:53 -07:00
Ville Skyttä b89c53f759
Type hint device registry identifiers as set of str 2-tuples (#50355)
* Type hint device registry identifiers as set of str 2-tuples

* Fix airly test

* Really fix airly test, add another migration test
2021-05-10 12:13:45 +02:00
Ville Skyttä ddd7e79ee9
Improve device registry internal typing (#49924) 2021-05-01 12:33:31 -10:00
Ville Skyttä a19f757120
Allow str 1..n-tuples in device registry identifier type hints (#49864)
This reflects current practice, but the intent has been to have them as
2-tuples, and a future change is likely to start enforcing that (again).

Refs https://github.com/home-assistant/core/pull/49670#discussion_r622344872
2021-04-30 08:56:55 +02: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
Franck Nijhof 38d14702fa
Remove HomeAssistantType alias from helpers (#48400) 2021-03-27 12:55:24 +01:00
Franck Nijhof dc15f243e6
Upgrade pyupgrade to v2.11.0 (#48220) 2021-03-22 13:29:39 +01:00
Marc Mueller 4cb7718192
Update typing 16 (#48087) 2021-03-18 22:58:19 +01:00
Marc Mueller 6fb2e63e49
Update typing 02 (#48014) 2021-03-17 18:34:19 +01:00
Erik Montnemery 504e5b77ca
Improve behaviour when disabling or enabling config entries (#47301) 2021-03-03 10:12:37 -08:00
Erik Montnemery 5e26bda52d
Add support for disabling config entries (#46779) 2021-02-20 19:21:39 -08: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
J. Nick Koston c9df42b69a
Add support for pre-filtering events to the event bus (#46371) 2021-02-14 09:42:55 -10:00
Erik Montnemery ed31cc363b
Wait for registries to load at startup (#46265)
* Wait for registries to load at startup

* Don't decorate new functions with @bind_hass

* Fix typing errors in zwave_js

* Load registries in async_test_home_assistant

* Tweak

* Typo

* Tweak

* Explicitly silence mypy errors

* Fix tests

* Fix more tests

* Fix test

* Improve docstring

* Wait for registries to load
2021-02-11 17:36:19 +01:00
J. Nick Koston a1662b3bb9
Restore the device id after deleting and re-adding an integration (#45348) 2021-01-27 17:10:57 +01:00
Ville Skyttä 20e2493f68
Improve device registry type hints (#44919)
* Fix async_get_or_create via_device type hint

* Specify collection element types
2021-01-08 02:38:57 +01:00
Ville Skyttä 2fb3be50ab
Make DeviceRegistry.async_get_device connections arg optional (#44897)
* 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
Ville Skyttä 65e56d03bf
Complete device and entity registry type hints (#44406) 2021-01-05 02:03:16 +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
Erik Montnemery dc8364fd3a
Support disabling devices (#43293) 2020-11-26 16:45:02 +01:00
Erik Montnemery 8a7febcfbe
Improve restore of deleted devices (#42703)
* Improve restore of deleted devices

* Simplify
2020-11-10 22:14:39 +01:00
J. Nick Koston 8d5c124deb
Improve performance of generating non-cryptographically secure uuids (#41314) 2020-10-07 16:37:01 +02:00
Erik Montnemery 863b63d75e
Fix handling of device registry defaults (#39688) 2020-09-06 21:08:50 -05:00
J. Nick Koston bee6d87e7a
Standardize uuid generation for events/storage/registry (#39184) 2020-08-24 17:21:30 +02:00
Paulus Schoutsen b3571602bb
Add default_* to device registry (#38829) 2020-08-13 10:38:56 +02:00
J. Nick Koston 6ea5c8aed9
Index the device registry (#37990) 2020-07-19 23:32:05 -07:00
Ville Skyttä ac0dbb17af
Attrs cleanups (#37849) 2020-07-14 10:30:30 -07:00
Erik Montnemery 7722e417ad
Stable device id when a deleted device is restored (#36309)
* Stable device id when a deleted device is restored.

* Tweak

* Store only basic data for deleted devices

* Simplify code

* Simplify code

* Address review comments.

* Improve test

* Fix missing save
2020-06-02 21:22:08 +02:00
Andre Lengwenus 919f3243de
Fix device_registry cleanup behavior (#35977)
* Fix: Only decives which are not referenced by an entity or a config_entry are removed

* Adapted test for async_cleanup

* Changed variable names
2020-05-23 09:46:03 +02:00
Paulus Schoutsen 4ae31bc938
Clean up device registry if entity registry updates (#35106) 2020-05-05 10:53:46 -07:00
Paulus Schoutsen e54e9279e3
Extract instance ID helper from updater (#35043) 2020-05-04 11:23:12 -07:00
Paulus Schoutsen b90cb09fd1
Add type to device registry (#35095) 2020-05-03 13:56:58 -07:00
Paulus Schoutsen 6056753a9c
Introduce a singleton decorator (#34803) 2020-04-30 16:47:14 -07:00
Martin Hjelmare fbde040f59
Complete device registry update (#34500)
* Add manufacturer and model parameters to device registry update
  method.
2020-04-21 19:40:16 +02:00