We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ec8678 commit 35c1327Copy full SHA for 35c1327
1 file changed
custom_components/bhyve/config_flow.py
@@ -222,13 +222,18 @@ async def async_step_init(
222
if d.get("type") != DEVICE_BRIDGE
223
}
224
225
+ # Filter saved defaults to only include devices that still exist,
226
+ # in case a device was removed from the B-hyve account.
227
+ saved_devices = self.config_entry.options.get(CONF_DEVICES, [])
228
+ valid_defaults = [d for d in saved_devices if d in device_options]
229
+
230
return self.async_show_form(
231
step_id="init",
232
data_schema=vol.Schema(
233
{
234
vol.Required(
235
CONF_DEVICES,
- default=self.config_entry.options.get(CONF_DEVICES),
236
+ default=valid_defaults,
237
): cv.multi_select(device_options),
238
239
),
0 commit comments