Commit graph

57 commits

Author SHA1 Message Date
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
J. Nick Koston
c9df42b69a
Add support for pre-filtering events to the event bus () 2021-02-14 09:42:55 -10:00
Erik Montnemery
ed31cc363b
Wait for registries to load at startup ()
* 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 () 2021-01-27 17:10:57 +01:00
Ville Skyttä
20e2493f68
Improve device registry type hints ()
* 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 ()
* 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 () 2021-01-05 02:03:16 +01:00
Ville Skyttä
317ed418dd
Use singleton enum for "not set" sentinels ()
* 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 () 2020-11-26 16:45:02 +01:00
Erik Montnemery
8a7febcfbe
Improve restore of deleted devices ()
* 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 () 2020-10-07 16:37:01 +02:00
Erik Montnemery
863b63d75e
Fix handling of device registry defaults () 2020-09-06 21:08:50 -05:00
J. Nick Koston
bee6d87e7a
Standardize uuid generation for events/storage/registry () 2020-08-24 17:21:30 +02:00
Paulus Schoutsen
b3571602bb
Add default_* to device registry () 2020-08-13 10:38:56 +02:00
J. Nick Koston
6ea5c8aed9
Index the device registry () 2020-07-19 23:32:05 -07:00
Ville Skyttä
ac0dbb17af
Attrs cleanups () 2020-07-14 10:30:30 -07:00
Erik Montnemery
7722e417ad
Stable device id when a deleted device is restored ()
* 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 ()
* 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 () 2020-05-05 10:53:46 -07:00
Paulus Schoutsen
e54e9279e3
Extract instance ID helper from updater () 2020-05-04 11:23:12 -07:00
Paulus Schoutsen
b90cb09fd1
Add type to device registry () 2020-05-03 13:56:58 -07:00
Paulus Schoutsen
6056753a9c
Introduce a singleton decorator () 2020-04-30 16:47:14 -07:00
Martin Hjelmare
fbde040f59
Complete device registry update ()
* Add manufacturer and model parameters to device registry update
  method.
2020-04-21 19:40:16 +02:00
Alexei Chetroi
440c837eb6
Allow sw_version update of a device registry entry. () 2020-03-11 09:31:02 -07:00
Paulus Schoutsen
e9e44dbd97
Fix callback and async ()
* Fix callback and async

* Fix a return

* Fix test

* Fix mqtt tests

* Fix some more callbacks
2020-01-29 13:59:45 -08:00
Paulus Schoutsen
3348f4f6d1
Add search integration ()
* Add search integration

* Add scenes and config entry support

* Update comments

* Add support for groups

* Allow querying config entry

* Update manifest

* Fix scene tests
2020-01-10 19:57:37 +01:00
Ville Skyttä
868eb3c735 More helpers type improvements () 2019-12-22 19:51:39 +01:00
Ville Skyttä
6604680793
Helpers type hint improvements () 2019-12-21 09:23:48 +02:00
Bas Nijholt
67c56c860d Sort imports according to PEP8 for 'homeassistant' folder ()
Components are already done
2019-12-09 16:42:10 +01:00
Bram Kragten
b75639d9d1 Remove lamps and groups from ha when removed from Hue ()
* Remove light when removed from hue

* add remove_config_entry_id

* Review + bump aiohue

* lint

* Add tests
2019-09-25 14:00:18 -07:00
Ville Skyttä
aa508b5106 Complete some incomplete type hints in helpers () 2019-08-15 08:53:25 -07:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
Ville Skyttä
d64f1e767c Type check all helpers ()
* Type check all helpers, add inline exclusions for work in progress

* Remove unused Script._template_cache

* Add some missing type hints

* Remove unneeded type: ignore

* Type hint fixes

* Mypy assistance tweaks

* Don't look for None in deprecated config "at most once" check

* Avoid None name slugify attempt when generating entity id

* Avoid None state store attempt on entity remove
2019-07-21 09:59:02 -07:00
Aaron Bach
a491f97eb9 Allow updating of via_device in device registry ()
* Allow updating of via_device in device registry

* Added test
2019-07-04 19:10:23 -04:00
Penny Wood
23dd644f4a Update IDs for rename node/value ()
* Update IDs for rename node/value

* Rename devices and entities

* Improved coverage
2019-07-01 15:54:19 -07:00
David F. Mulcahey
d9420c1f73 Remove device and entity registry entries when removing a ZHA device ()
* cleanup when device is removed

fixes

* cleanup
2019-06-24 11:26:44 -07:00
Penny Wood
84e6813779 Rename via_hub to via_device ()
* Rename via_hub to via_device

* Fixed registry interactions
2019-06-10 09:10:44 -07:00
Penny Wood
f991ec15f2 Delete devices / entities when we remove a config entry. ()
* Remove device when last config entry removed

* Remove entities when config entry removed

* Update tests to use new behaviour
2019-05-19 11:41:39 +02:00
Paulus Schoutsen
07ee3b2eb9
Add update events to registries ()
* Add update events to registries

* Add to websocket
2019-05-07 20:04:57 -07:00
Andrew Sayre
cfaaae661a Add core APIs to migrate device identifiers and entity unique_id ()
* Add device identifiers migration

* Add entity unique_id migration

* Update per arch issue

* Move to existing update methods
2019-04-30 10:04:37 -07:00
Penny Wood
646c4a7137
Bootstrap to start registry loading early ()
* Registries store directly in data on loading.

* Loading registries concurent with stage 1.

* Removed comments
2019-03-27 22:06:20 +08:00
Paulus Schoutsen
4f5446ff02
Add area permission check () 2019-03-11 11:02:37 -07:00
Paulus Schoutsen
8213016eaf
Allow targeting areas in service calls ()
* Allow targeting areas in service calls

* Lint + Type

* Address comments
2019-03-04 09:51:12 -08:00
David F. Mulcahey
c4400be62a Add friendly name to devices in the device registry ()
* add friendly name to devices in the device registry

* switch to name_by_user

* review comments
2019-02-26 12:20:16 -08:00
Robert Svensson
bd335e1ac1 Area registry ()
* First draft of area registry

* Refactor based on input

* Add tests for areas
Add tests for updating device

* Updating a device shouldn't require area

* Fix Martins comment

* Require admin

* Save after deleting

* Rename read to list_areas
Fix device entry_dict
Remove area id from device when deleting area

* Fix tests
2019-01-28 15:52:42 -08:00
Steven Looman
501b3f9927 Disable creating port mappings from UI, add discovery from component ()
* Disable creating port mappings from UI, add discovery from component

* Remove unused constant

* Upgrade to async_upnp_client==0.13.6 and use manufacturer from device

* Upgrade to async_upnp_client==0.13.7
2018-12-21 17:25:23 +00:00
Paulus Schoutsen
43ae57cc59 Lint 2018-11-06 19:27:52 +01:00
Paulus Schoutsen
bde02afe4f Normalize MAC addresses ()
* Normalize MAC addresses

* Handle all mac formats
2018-11-06 16:33:31 +01:00
Paulus Schoutsen
b5284aa445 Fix device reg considered changed ()
* Fix device reg considered changed

* Better syntax
2018-10-25 16:43:11 +02:00
Paulus Schoutsen
da3342f1aa
Update new values coming in for dev registry ()
* Update new values coming in for dev registry

* fix Lint+Test;2C
2018-09-27 11:26:58 +02:00