Skip to content

Commit bdbb98d

Browse files
committed
fix: avoid config UI 500 by using OptionsFlowWithConfigEntry subclass
1 parent b82db9d commit bdbb98d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

custom_components/econnect_metronet/config_flow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async def async_step_user(self, user_input=None):
101101
)
102102

103103

104-
class OptionsFlowHandler(config_entries.OptionsFlow):
104+
class OptionsFlowHandler(config_entries.OptionsFlowWithConfigEntry):
105105
"""Reconfigure integration options.
106106
107107
Available options are:
@@ -113,7 +113,7 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
113113

114114
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
115115
"""Construct."""
116-
self.config_entry = config_entry
116+
super().__init__(config_entry)
117117

118118
async def async_step_init(self, user_input=None):
119119
"""Manage the options."""

tests/test_options_flow.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ async def test_form_submit_successful_with_identifier(self, hass, config_entry):
114114
"areas_arm_night": [],
115115
"areas_arm_vacation": [],
116116
}
117-
assert result["result"] is True
118117

119118
async def test_form_submit_successful_with_input(self, hass, config_entry):
120119
# Ensure users can submit an option that is available in the allowed list
@@ -140,7 +139,6 @@ async def test_form_submit_successful_with_input(self, hass, config_entry):
140139
"areas_arm_night": [],
141140
"areas_arm_vacation": [],
142141
}
143-
assert result["result"] is True
144142

145143
async def test_form_submit_successful_with_multiple_inputs(self, hass, config_entry):
146144
# Ensure multiple options can be submitted at once
@@ -173,4 +171,3 @@ async def test_form_submit_successful_with_multiple_inputs(self, hass, config_en
173171
"areas_arm_night": [(1, "S1 Living Room")],
174172
"areas_arm_vacation": [(1, "S1 Living Room"), (2, "S2 Bedroom")],
175173
}
176-
assert result["result"] is True

0 commit comments

Comments
 (0)