From b105b0fbcbe9f5ac32fbcfa4c70570b7812e128e Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Wed, 13 Jul 2022 22:05:43 +0200 Subject: [PATCH] Make sure device tuple is a list on save (#75103) --- homeassistant/components/rfxtrx/config_flow.py | 2 +- tests/components/rfxtrx/test_config_flow.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/rfxtrx/config_flow.py b/homeassistant/components/rfxtrx/config_flow.py index 61d01b8d533..508ca9a7037 100644 --- a/homeassistant/components/rfxtrx/config_flow.py +++ b/homeassistant/components/rfxtrx/config_flow.py @@ -199,7 +199,7 @@ class OptionsFlow(config_entries.OptionsFlow): if not errors: devices = {} device = { - CONF_DEVICE_ID: device_id, + CONF_DEVICE_ID: list(device_id), } devices[self._selected_device_event_code] = device diff --git a/tests/components/rfxtrx/test_config_flow.py b/tests/components/rfxtrx/test_config_flow.py index 2c695d71d2e..eaa7f1c79a1 100644 --- a/tests/components/rfxtrx/test_config_flow.py +++ b/tests/components/rfxtrx/test_config_flow.py @@ -867,6 +867,9 @@ async def test_options_configure_rfy_cover_device(hass): entry.data["devices"]["0C1a0000010203010000000000"]["venetian_blind_mode"] == "EU" ) + assert isinstance( + entry.data["devices"]["0C1a0000010203010000000000"]["device_id"], list + ) device_registry = dr.async_get(hass) 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"] == "EU" ) + assert isinstance( + entry.data["devices"]["0C1a0000010203010000000000"]["device_id"], list + ) def test_get_serial_by_id_no_dir():