mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 02:38:10 +02:00
Only apply OptionsFlowWithConfigEntry deprecation to core (#130054)
* Only apply OptionsFlowWithConfigEntry deprecation to core * Fix match string in pytest.raises * Improve coverage
This commit is contained in:
@ -63,7 +63,7 @@ from .helpers.event import (
|
||||
RANDOM_MICROSECOND_MIN,
|
||||
async_call_later,
|
||||
)
|
||||
from .helpers.frame import report
|
||||
from .helpers.frame import ReportBehavior, report, report_usage
|
||||
from .helpers.json import json_bytes, json_bytes_sorted, json_fragment
|
||||
from .helpers.typing import UNDEFINED, ConfigType, DiscoveryInfoType, UndefinedType
|
||||
from .loader import async_suggest_report_issue
|
||||
@ -3168,17 +3168,21 @@ class OptionsFlow(ConfigEntryBaseFlow):
|
||||
|
||||
|
||||
class OptionsFlowWithConfigEntry(OptionsFlow):
|
||||
"""Base class for options flows with config entry and options."""
|
||||
"""Base class for options flows with config entry and options.
|
||||
|
||||
This class is being phased out, and should not be referenced in new code.
|
||||
It is kept only for backward compatibility, and only for custom integrations.
|
||||
"""
|
||||
|
||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
||||
"""Initialize options flow."""
|
||||
self._config_entry = config_entry
|
||||
self._options = deepcopy(dict(config_entry.options))
|
||||
report(
|
||||
"inherits from OptionsFlowWithConfigEntry, which is deprecated "
|
||||
"and will stop working in 2025.12",
|
||||
error_if_integration=False,
|
||||
error_if_core=True,
|
||||
report_usage(
|
||||
"inherits from OptionsFlowWithConfigEntry",
|
||||
core_behavior=ReportBehavior.ERROR,
|
||||
core_integration_behavior=ReportBehavior.ERROR,
|
||||
custom_integration_behavior=ReportBehavior.IGNORE,
|
||||
)
|
||||
|
||||
@property
|
||||
|
Reference in New Issue
Block a user