Add friendly name to devices in the device registry (#21318)

* add friendly name to devices in the device registry

* switch to name_by_user

* review comments
This commit is contained in:
David F. Mulcahey authored and Paulus Schoutsen committed 2019-02-26 12:20:16 -08:00
1 parent a34524febe
commit c4400be62a
4 files changed
+34 -10

No files matched your search

@@ -49,6 +49,7 @@ async def test_list_devices(hass, client, registry):
'sw_version': None,
'hub_device_id': None,
'area_id': None,
'name_by_user': None,
},
{
'config_entries': ['1234'],
@@ -59,6 +60,7 @@ async def test_list_devices(hass, client, registry):
'sw_version': None,
'hub_device_id': dev1,
'area_id': None,
'name_by_user': None,
}
]
@@ -72,11 +74,13 @@ async def test_update_device(hass, client, registry):
manufacturer='manufacturer', model='model')
assert not device.area_id
assert not device.name_by_user
await client.send_json({
'id': 1,
'device_id': device.id,
'area_id': '12345A',
'name_by_user': 'Test Friendly Name',
'type': 'config/device_registry/update',
})
@@ -84,4 +88,5 @@ async def test_update_device(hass, client, registry):
assert msg['result']['id'] == device.id
assert msg['result']['area_id'] == '12345A'
assert msg['result']['name_by_user'] == 'Test Friendly Name'
assert len(registry.devices) == 1