Complete device registry update (#34500)
* Add manufacturer and model parameters to device registry update method.pull/34509/head
parent
220baed33a
commit
fbde040f59
|
@ -152,6 +152,8 @@ class DeviceRegistry:
|
|||
device_id,
|
||||
*,
|
||||
area_id=_UNDEF,
|
||||
manufacturer=_UNDEF,
|
||||
model=_UNDEF,
|
||||
name=_UNDEF,
|
||||
name_by_user=_UNDEF,
|
||||
new_identifiers=_UNDEF,
|
||||
|
@ -163,6 +165,8 @@ class DeviceRegistry:
|
|||
return self._async_update_device(
|
||||
device_id,
|
||||
area_id=area_id,
|
||||
manufacturer=manufacturer,
|
||||
model=model,
|
||||
name=name,
|
||||
name_by_user=name_by_user,
|
||||
new_identifiers=new_identifiers,
|
||||
|
|
|
@ -397,6 +397,8 @@ async def test_update(registry):
|
|||
updated_entry = registry.async_update_device(
|
||||
entry.id,
|
||||
area_id="12345A",
|
||||
manufacturer="Test Producer",
|
||||
model="Test Model",
|
||||
name_by_user="Test Friendly Name",
|
||||
new_identifiers=new_identifiers,
|
||||
via_device_id="98765B",
|
||||
|
@ -405,6 +407,8 @@ async def test_update(registry):
|
|||
assert mock_save.call_count == 1
|
||||
assert updated_entry != entry
|
||||
assert updated_entry.area_id == "12345A"
|
||||
assert updated_entry.manufacturer == "Test Producer"
|
||||
assert updated_entry.model == "Test Model"
|
||||
assert updated_entry.name_by_user == "Test Friendly Name"
|
||||
assert updated_entry.identifiers == new_identifiers
|
||||
assert updated_entry.via_device_id == "98765B"
|
||||
|
|
Loading…
Reference in New Issue