mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Use new helper properties in motioneye options flow (#129780)
This commit is contained in:
parent
b48e2127b8
commit
461dc13da9
@ -179,18 +179,16 @@ class MotionEyeConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
|
||||
@staticmethod
|
||||
@callback
|
||||
def async_get_options_flow(config_entry: ConfigEntry) -> MotionEyeOptionsFlow:
|
||||
def async_get_options_flow(
|
||||
config_entry: ConfigEntry,
|
||||
) -> MotionEyeOptionsFlow:
|
||||
"""Get the Hyperion Options flow."""
|
||||
return MotionEyeOptionsFlow(config_entry)
|
||||
return MotionEyeOptionsFlow()
|
||||
|
||||
|
||||
class MotionEyeOptionsFlow(OptionsFlow):
|
||||
"""motionEye options flow."""
|
||||
|
||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
||||
"""Initialize a motionEye options flow."""
|
||||
self._config_entry = config_entry
|
||||
|
||||
async def async_step_init(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
) -> ConfigFlowResult:
|
||||
@ -201,14 +199,14 @@ class MotionEyeOptionsFlow(OptionsFlow):
|
||||
schema: dict[vol.Marker, type] = {
|
||||
vol.Required(
|
||||
CONF_WEBHOOK_SET,
|
||||
default=self._config_entry.options.get(
|
||||
default=self.config_entry.options.get(
|
||||
CONF_WEBHOOK_SET,
|
||||
DEFAULT_WEBHOOK_SET,
|
||||
),
|
||||
): bool,
|
||||
vol.Required(
|
||||
CONF_WEBHOOK_SET_OVERWRITE,
|
||||
default=self._config_entry.options.get(
|
||||
default=self.config_entry.options.get(
|
||||
CONF_WEBHOOK_SET_OVERWRITE,
|
||||
DEFAULT_WEBHOOK_SET_OVERWRITE,
|
||||
),
|
||||
@ -219,9 +217,9 @@ class MotionEyeOptionsFlow(OptionsFlow):
|
||||
# The input URL is not validated as being a URL, to allow for the possibility
|
||||
# the template input won't be a valid URL until after it's rendered
|
||||
description: dict[str, str] | None = None
|
||||
if CONF_STREAM_URL_TEMPLATE in self._config_entry.options:
|
||||
if CONF_STREAM_URL_TEMPLATE in self.config_entry.options:
|
||||
description = {
|
||||
"suggested_value": self._config_entry.options[
|
||||
"suggested_value": self.config_entry.options[
|
||||
CONF_STREAM_URL_TEMPLATE
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user