Allow sw_version update of a device registry entry. (#32630)
This commit is contained in:
1 parent
ffe8b94d75
commit
440c837eb6
2 files changed
+20
No files matched your search
@@ -480,3 +480,21 @@ async def test_loading_race_condition(hass):
|
||||
|
||||
mock_load.assert_called_once_with()
|
||||
assert results[0] == results[1]
|
||||
|
||||
|
||||
async def test_update_sw_version(registry):
|
||||
"""Verify that we can update software version of a device."""
|
||||
entry = registry.async_get_or_create(
|
||||
config_entry_id="1234",
|
||||
connections={(device_registry.CONNECTION_NETWORK_MAC, "12:34:56:AB:CD:EF")},
|
||||
identifiers={("bla", "123")},
|
||||
)
|
||||
assert not entry.sw_version
|
||||
sw_version = "0x20020263"
|
||||
|
||||
with patch.object(registry, "async_schedule_save") as mock_save:
|
||||
updated_entry = registry.async_update_device(entry.id, sw_version=sw_version)
|
||||
|
||||
assert mock_save.call_count == 1
|
||||
assert updated_entry != entry
|
||||
assert updated_entry.sw_version == sw_version
|
||||
Reference in new issue
Block a user