J. Nick Koston
e1e64be3c9
Remigrate device_registry created_at/modified_at ( #122490 )
...
* Remigrate device_registry created_at/modified_at
Nightly current does not boot up because the device registry
will have KeyError: created_at if the previous nightly was
installed.
* reduce
* split migration per discord comments
2024-07-23 15:47:27 -05:00
Robert Resch
4c853803f1
Add created_at/modified_at to device registry ( #122369 )
2024-07-22 19:15:23 +02:00
Joost Lekkerkerker
f8ba4d41ba
Add support for adding model_id in device info ( #121989 )
2024-07-16 15:12:25 +02:00
Erik Montnemery
3e9b57cc07
Don't allow updating a device to have no connections or identifiers ( #120603 )
...
* Don't allow updating a device to have no connections or identifiers
* Move check to the top of the function
2024-06-27 09:26:31 +02:00
Erik Montnemery
9bbeb5d608
Add primary_config_entry attribute to device registry entries ( #119959 )
...
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Robert Resch <robert@resch.dev>
2024-06-26 12:26:24 +02:00
Erik Montnemery
d4e93dd01d
Validate new device identifiers and connections ( #120413 )
2024-06-25 19:17:54 +02:00
Paulus Schoutsen
eb89ce47ea
Inline primary integration ( #119860 )
2024-06-18 08:08:08 +02:00
Paulus Schoutsen
836abe68c7
Track primary integration ( #119741 )
...
* Track primary integration
* Update snapshots
* More snapshots updated
* Uno mas
* Update snapshot
2024-06-16 13:26:06 -04:00
epenet
eb6af2238c
Improve type hints in registry helper tests ( #119302 )
2024-06-10 20:25:34 +02:00
epenet
41e852a01b
Add ability to replace connections in DeviceRegistry ( #118555 )
...
* Add ability to replace connections in DeviceRegistry
* Add more tests
* Improve coverage
* Apply suggestion
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-05-31 15:31:44 -04:00
J. Nick Koston
7871e9279b
Adjust thread safety check messages to point to developer docs ( #117392 )
2024-05-14 15:20:31 +02:00
J. Nick Koston
09ebbfa0e1
Move thread safety check in device_registry sooner ( #116264 )
...
It turns out we have custom components that are writing to the device registry using the async APIs from threads. We now catch it at the point async_fire is called. Instead we should check sooner and use async_fire_internal so we catch the unsafe operation before it can corrupt the registry.
2024-04-27 09:24:55 +02:00
Alberto Montes
c94b0a82ca
Make release channel a hardcoded enum rather than a free form string ( #115595 )
...
* Make release channel a hardcoded enum rather than a free form string
* Update enum comparison to remove equality and us identity comparison
* Fix comparison condition to match the previous implementation
* Update tests to use Enum instead of string
2024-04-20 20:01:49 +02:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 ( #112690 )
...
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Sid
00ec7f11f0
Enable Ruff rule PT007 ( #113764 )
...
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
Marc Mueller
19ab3d6daf
Add empty line after module docstring [helpers + other] ( #112707 )
2024-03-08 10:36:11 -05:00
Erik Montnemery
b336095239
Allow translating device names ( #110711 )
...
* Allow translating device names
* Don't keep a reference to translations in config entry
* Update kitchen_sink tests
* Add tests
2024-02-28 15:59:59 +01:00
J. Nick Koston
776a9b8691
Make device registry cleanup a callback function ( #111052 )
...
* Add async_schedule_call to the Debouncer
async_schedule_call allows the Debouncer to schedule a call
from a callback without having to create tasks to run
async_call
* Update homeassistant/helpers/debounce.py
* Make device registry cleanup all callback function
* fix typing, code supported callback functions, but typing did not
* fixes
* fixes
* fix
* we had no coverage for other job types
* we had no coverage for other job types
2024-02-21 09:34:49 +01:00
Franck Nijhof
e0a9dcd996
Add label registry ( #110821 )
2024-02-19 11:59:08 +01:00
Franck Nijhof
0fbadc274a
Cleanups in device registry tests ( #110786 )
2024-02-17 14:06:53 +01:00
J. Nick Koston
c399cab427
Small speed up to checking core state ( #107845 )
2024-01-18 08:41:32 -10:00
Erik Montnemery
c805ea7b4f
Include deprecated constants in wildcard imports ( #107114 )
2024-01-05 11:46:45 +01:00
Robert Resch
e18d2b8873
Deprecate deprecated device_registry helper constants ( #106227 )
2023-12-22 11:21:45 +01:00
Franck Nijhof
70ad5ab3e4
Update helper tests to use device & entity registry fixtures ( #103710 )
2023-11-10 09:32:19 +01:00
Erik Montnemery
1621310ba7
Add serial_number to device registry entries ( #102334 )
...
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-10-22 15:14:44 +02:00
Erik Montnemery
4e8b81370e
Adjust device_registry tests which create devices ( #98215 )
2023-08-10 19:28:33 +02:00
Franck Nijhof
af5fc7e759
Ensure load the device registry if it contains invalid configuration URLs ( #97589 )
2023-08-01 23:15:31 +02:00
Franck Nijhof
737ac8c600
Fix DeviceInfo configuration_url validation ( #97319 )
2023-07-27 18:57:01 +02:00
Erik Montnemery
614f3c6a15
Move device info validation to device registry ( #96465 )
...
* Move device info validation to device registry
* Don't move DeviceInfo
* Fix type annotation
* Don't block adding device for unknown config entry
* Fix test
* Remove use of locals()
* Improve error message
2023-07-14 08:55:17 -04:00
Erik Montnemery
7539cf25be
Don't require passing identifiers to DeviceRegistry.async_get_device ( #96479 )
...
* Require keyword arguments to DeviceRegistry.async_get_device
* Update tests
* Update tests
* Don't enforce keyword arguments
2023-07-13 13:39:25 -04:00
epenet
5f25b71df7
Add type hints to core tests ( #88478 )
2023-02-20 11:42:56 +01:00
Franck Nijhof
80bf632e2d
Clean up unnecessary registry mocks from helpers ( #87734 )
2023-02-08 20:15:29 -05:00
epenet
c98b4e3204
Add typing to tests with single hass argument (2) ( #87675 )
...
* Add typing to tests with single hass argument (2)
* a few more
2023-02-08 08:51:43 +01:00
Franck Nijhof
5e81d28116
Update black to 23.1.0 ( #87188 )
2023-02-02 18:35:24 +01:00
Erik Montnemery
11c174aca3
Revert "Add aliases to device registry items" ( #84976 )
2023-01-02 12:30:25 +01:00
Erik Montnemery
057bb6ea0a
Add aliases to device registry items ( #84246 )
2022-12-20 23:43:31 +01:00
Erik Montnemery
53263ea9bc
Revert "Add serial_number to device registry entries" ( #79139 )
2022-09-27 16:36:38 +02:00
Erik Montnemery
cba3b6ad94
Add serial_number to device registry entries ( #77713 )
2022-09-27 09:08:54 +02:00
Erik Montnemery
51c5f1d16a
Remove useless device_registry test ( #77714 )
2022-09-02 20:44:42 +00:00
Erik Montnemery
8924725d69
Improve some device registry tests ( #77659 )
2022-09-02 08:54:02 +02:00
J. Nick Koston
c2c6d12d73
Only fire device_registry_updated for suggested_area if the suggestion results in an area change ( #69215 )
2022-04-04 09:51:39 +02:00
Erik Montnemery
dcb3fc49c9
Include changes in EVENT_DEVICE_REGISTRY_UPDATED ( #66641 )
2022-02-16 12:29:08 +01:00
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
J. Nick Koston
04153c0075
Add hardware version to the device registry ( #61650 )
2021-12-16 05:16:19 -06: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
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
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
Ville Skyttä
39691faccc
Use DeviceEntryType in non-typechecked code too ( #58646 )
2021-11-23 10:04:33 +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