1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Update new values coming in for dev registry (#16852)

* Update new values coming in for dev registry

* fix Lint+Test;2C
This commit is contained in:
Paulus Schoutsen
2018-09-27 11:26:58 +02:00
committed by GitHub
parent 29db43edb2
commit da3342f1aa
3 changed files with 66 additions and 39 deletions

View File

@@ -17,7 +17,10 @@ async def test_get_or_create_returns_same_entry(registry):
config_entry_id='1234',
connections={('ethernet', '12:34:56:78:90:AB:CD:EF')},
identifiers={('bridgeid', '0123')},
manufacturer='manufacturer', model='model')
sw_version='sw-version',
name='name',
manufacturer='manufacturer',
model='model')
entry2 = registry.async_get_or_create(
config_entry_id='1234',
connections={('ethernet', '11:22:33:44:55:66:77:88')},
@@ -25,15 +28,19 @@ async def test_get_or_create_returns_same_entry(registry):
manufacturer='manufacturer', model='model')
entry3 = registry.async_get_or_create(
config_entry_id='1234',
connections={('ethernet', '12:34:56:78:90:AB:CD:EF')},
identifiers={('bridgeid', '1234')},
manufacturer='manufacturer', model='model')
connections={('ethernet', '12:34:56:78:90:AB:CD:EF')}
)
assert len(registry.devices) == 1
assert entry.id == entry2.id
assert entry.id == entry3.id
assert entry.identifiers == {('bridgeid', '0123')}
assert entry3.manufacturer == 'manufacturer'
assert entry3.model == 'model'
assert entry3.name == 'name'
assert entry3.sw_version == 'sw-version'
async def test_requirement_for_identifier_or_connection(registry):
"""Make sure we do require some descriptor of device."""