Skip to content

Commit d6e73a8

Browse files
authored
Cleanup unnecessary __init__ method in OptionsFlow (#129651)
* Cleanup unnecessary init step in OptionsFlow * Increase coverage
1 parent 269aefd commit d6e73a8

File tree

68 files changed

+93
-336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+93
-336
lines changed

homeassistant/components/canary/config_flow.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CanaryConfigFlow(ConfigFlow, domain=DOMAIN):
5252
@callback
5353
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow:
5454
"""Get the options flow for this handler."""
55-
return CanaryOptionsFlowHandler(config_entry)
55+
return CanaryOptionsFlowHandler()
5656

5757
async def async_step_import(self, import_data: dict[str, Any]) -> ConfigFlowResult:
5858
"""Handle a flow initiated by configuration file."""
@@ -104,10 +104,6 @@ async def async_step_user(
104104
class CanaryOptionsFlowHandler(OptionsFlow):
105105
"""Handle Canary client options."""
106106

107-
def __init__(self, config_entry: ConfigEntry) -> None:
108-
"""Initialize options flow."""
109-
self.config_entry = config_entry
110-
111107
async def async_step_init(
112108
self, user_input: dict[str, Any] | None = None
113109
) -> ConfigFlowResult:

homeassistant/components/coinbase/config_flow.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,12 @@ def async_get_options_flow(
158158
config_entry: ConfigEntry,
159159
) -> OptionsFlowHandler:
160160
"""Get the options flow for this handler."""
161-
return OptionsFlowHandler(config_entry)
161+
return OptionsFlowHandler()
162162

163163

164164
class OptionsFlowHandler(OptionsFlow):
165165
"""Handle a option flow for Coinbase."""
166166

167-
def __init__(self, config_entry: ConfigEntry) -> None:
168-
"""Initialize options flow."""
169-
self.config_entry = config_entry
170-
171167
async def async_step_init(
172168
self, user_input: dict[str, Any] | None = None
173169
) -> ConfigFlowResult:

homeassistant/components/control4/config_flow.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,12 @@ def async_get_options_flow(
154154
config_entry: ConfigEntry,
155155
) -> OptionsFlowHandler:
156156
"""Get the options flow for this handler."""
157-
return OptionsFlowHandler(config_entry)
157+
return OptionsFlowHandler()
158158

159159

160160
class OptionsFlowHandler(OptionsFlow):
161161
"""Handle a option flow for Control4."""
162162

163-
def __init__(self, config_entry: ConfigEntry) -> None:
164-
"""Initialize options flow."""
165-
self.config_entry = config_entry
166-
167163
async def async_step_init(
168164
self, user_input: dict[str, Any] | None = None
169165
) -> ConfigFlowResult:

homeassistant/components/denonavr/config_flow.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@
5252
class OptionsFlowHandler(OptionsFlow):
5353
"""Options for the component."""
5454

55-
def __init__(self, config_entry: ConfigEntry) -> None:
56-
"""Init object."""
57-
self.config_entry = config_entry
58-
5955
async def async_step_init(
6056
self, user_input: dict[str, Any] | None = None
6157
) -> ConfigFlowResult:
@@ -119,7 +115,7 @@ def async_get_options_flow(
119115
config_entry: ConfigEntry,
120116
) -> OptionsFlowHandler:
121117
"""Get the options flow."""
122-
return OptionsFlowHandler(config_entry)
118+
return OptionsFlowHandler()
123119

124120
async def async_step_user(
125121
self, user_input: dict[str, Any] | None = None

homeassistant/components/dexcom/config_flow.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,12 @@ def async_get_options_flow(
6969
config_entry: ConfigEntry,
7070
) -> DexcomOptionsFlowHandler:
7171
"""Get the options flow for this handler."""
72-
return DexcomOptionsFlowHandler(config_entry)
72+
return DexcomOptionsFlowHandler()
7373

7474

7575
class DexcomOptionsFlowHandler(OptionsFlow):
7676
"""Handle a option flow for Dexcom."""
7777

78-
def __init__(self, config_entry: ConfigEntry) -> None:
79-
"""Initialize options flow."""
80-
self.config_entry = config_entry
81-
8278
async def async_step_init(
8379
self, user_input: dict[str, Any] | None = None
8480
) -> ConfigFlowResult:

homeassistant/components/dlna_dmr/config_flow.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def async_get_options_flow(
7474
config_entry: ConfigEntry,
7575
) -> OptionsFlow:
7676
"""Define the config flow to handle options."""
77-
return DlnaDmrOptionsFlowHandler(config_entry)
77+
return DlnaDmrOptionsFlowHandler()
7878

7979
async def async_step_user(self, user_input: FlowInput = None) -> ConfigFlowResult:
8080
"""Handle a flow initialized by the user.
@@ -327,10 +327,6 @@ class DlnaDmrOptionsFlowHandler(OptionsFlow):
327327
Configures the single instance and updates the existing config entry.
328328
"""
329329

330-
def __init__(self, config_entry: ConfigEntry) -> None:
331-
"""Initialize."""
332-
self.config_entry = config_entry
333-
334330
async def async_step_init(
335331
self, user_input: dict[str, Any] | None = None
336332
) -> ConfigFlowResult:

homeassistant/components/doorbird/config_flow.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,12 @@ def async_get_options_flow(
213213
config_entry: ConfigEntry,
214214
) -> OptionsFlowHandler:
215215
"""Get the options flow for this handler."""
216-
return OptionsFlowHandler(config_entry)
216+
return OptionsFlowHandler()
217217

218218

219219
class OptionsFlowHandler(OptionsFlow):
220220
"""Handle a option flow for doorbird."""
221221

222-
def __init__(self, config_entry: ConfigEntry) -> None:
223-
"""Initialize options flow."""
224-
self.config_entry = config_entry
225-
226222
async def async_step_init(
227223
self, user_input: dict[str, Any] | None = None
228224
) -> ConfigFlowResult:

homeassistant/components/esphome/config_flow.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,16 +482,12 @@ def async_get_options_flow(
482482
config_entry: ConfigEntry,
483483
) -> OptionsFlowHandler:
484484
"""Get the options flow for this handler."""
485-
return OptionsFlowHandler(config_entry)
485+
return OptionsFlowHandler()
486486

487487

488488
class OptionsFlowHandler(OptionsFlow):
489489
"""Handle a option flow for esphome."""
490490

491-
def __init__(self, config_entry: ConfigEntry) -> None:
492-
"""Initialize options flow."""
493-
self.config_entry = config_entry
494-
495491
async def async_step_init(
496492
self, user_input: dict[str, Any] | None = None
497493
) -> ConfigFlowResult:

homeassistant/components/ezviz/config_flow.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async def _validate_and_create_camera_rtsp(self, data: dict) -> ConfigFlowResult
150150
@callback
151151
def async_get_options_flow(config_entry: ConfigEntry) -> EzvizOptionsFlowHandler:
152152
"""Get the options flow for this handler."""
153-
return EzvizOptionsFlowHandler(config_entry)
153+
return EzvizOptionsFlowHandler()
154154

155155
async def async_step_user(
156156
self, user_input: dict[str, Any] | None = None
@@ -391,10 +391,6 @@ async def async_step_reauth_confirm(
391391
class EzvizOptionsFlowHandler(OptionsFlow):
392392
"""Handle EZVIZ client options."""
393393

394-
def __init__(self, config_entry: ConfigEntry) -> None:
395-
"""Initialize options flow."""
396-
self.config_entry = config_entry
397-
398394
async def async_step_init(
399395
self, user_input: dict[str, Any] | None = None
400396
) -> ConfigFlowResult:

homeassistant/components/forecast_solar/config_flow.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def async_get_options_flow(
4141
config_entry: ConfigEntry,
4242
) -> ForecastSolarOptionFlowHandler:
4343
"""Get the options flow for this handler."""
44-
return ForecastSolarOptionFlowHandler(config_entry)
44+
return ForecastSolarOptionFlowHandler()
4545

4646
async def async_step_user(
4747
self, user_input: dict[str, Any] | None = None
@@ -91,10 +91,6 @@ async def async_step_user(
9191
class ForecastSolarOptionFlowHandler(OptionsFlow):
9292
"""Handle options."""
9393

94-
def __init__(self, config_entry: ConfigEntry) -> None:
95-
"""Initialize options flow."""
96-
self.config_entry = config_entry
97-
9894
async def async_step_init(
9995
self, user_input: dict[str, Any] | None = None
10096
) -> ConfigFlowResult:

0 commit comments

Comments
 (0)