mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Fix missed case for device tuple fallback in rfxtrx (#93575)
* rfxtrx: add missed case for device tuple fallback Previously the code was prepared for a backward compatible migration of tuples, where both styles of identifiers might exist in device registry at the same time. This place was sadly missed * No need to raise special, we can assert instead * Add some basic tests
This commit is contained in:
@@ -89,6 +89,14 @@ async def test_get_actions(
|
||||
device_entry = device_registry.async_get_device(device.device_identifiers, set())
|
||||
assert device_entry
|
||||
|
||||
# Add alternate identifiers, to make sure we can handle future formats
|
||||
identifiers: list[str] = list(*device_entry.identifiers)
|
||||
device_registry.async_update_device(
|
||||
device_entry.id, merge_identifiers={(identifiers[0], "_".join(identifiers[1:]))}
|
||||
)
|
||||
device_entry = device_registry.async_get_device(device.device_identifiers, set())
|
||||
assert device_entry
|
||||
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user