Make sure device tuple is a list on save (#75103)

pull/75147/head
Joakim Plate 2022-07-13 22:05:43 +02:00 committed by Paulus Schoutsen
parent 98c3bc56b5
commit b105b0fbcb
2 changed files with 7 additions and 1 deletions

View File

@ -199,7 +199,7 @@ class OptionsFlow(config_entries.OptionsFlow):
if not errors: if not errors:
devices = {} devices = {}
device = { device = {
CONF_DEVICE_ID: device_id, CONF_DEVICE_ID: list(device_id),
} }
devices[self._selected_device_event_code] = device devices[self._selected_device_event_code] = device

View File

@ -867,6 +867,9 @@ async def test_options_configure_rfy_cover_device(hass):
entry.data["devices"]["0C1a0000010203010000000000"]["venetian_blind_mode"] entry.data["devices"]["0C1a0000010203010000000000"]["venetian_blind_mode"]
== "EU" == "EU"
) )
assert isinstance(
entry.data["devices"]["0C1a0000010203010000000000"]["device_id"], list
)
device_registry = dr.async_get(hass) device_registry = dr.async_get(hass)
device_entries = dr.async_entries_for_config_entry(device_registry, entry.entry_id) device_entries = dr.async_entries_for_config_entry(device_registry, entry.entry_id)
@ -904,6 +907,9 @@ async def test_options_configure_rfy_cover_device(hass):
entry.data["devices"]["0C1a0000010203010000000000"]["venetian_blind_mode"] entry.data["devices"]["0C1a0000010203010000000000"]["venetian_blind_mode"]
== "EU" == "EU"
) )
assert isinstance(
entry.data["devices"]["0C1a0000010203010000000000"]["device_id"], list
)
def test_get_serial_by_id_no_dir(): def test_get_serial_by_id_no_dir():