1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

Device registry store config entry (#16152)

* Allow device registry to optionally store config entries

* Connections and identifiers are now sets with tupels

* Make config entries mandatory

* Fix duplicate keys in test

* Rename device to device_info

* Entity platform should only create device entries if config_entry_id exists

* Fix Soundtouch tests

* Revert soundtouch to use self.device

* Fix baloobs comments

* Correct type in test
This commit is contained in:
Robert Svensson
2018-08-25 10:59:28 +02:00
committed by Paulus Schoutsen
parent 24a8d60566
commit 97173f495c
11 changed files with 142 additions and 61 deletions

View File

@@ -123,8 +123,9 @@ async def async_setup_entry(hass, config_entry):
device_registry = await \
hass.helpers.device_registry.async_get_registry()
device_registry.async_get_or_create(
connection=[[CONNECTION_NETWORK_MAC, deconz.config.mac]],
identifiers=[[DOMAIN, deconz.config.bridgeid]],
config_entry=config_entry.entry_id,
connections={(CONNECTION_NETWORK_MAC, deconz.config.mac)},
identifiers={(DOMAIN, deconz.config.bridgeid)},
manufacturer='Dresden Elektronik', model=deconz.config.modelid,
name=deconz.config.name, sw_version=deconz.config.swversion)