Skip to content

Add OptionsFlow to SMTP integration#173386

Open
tr4nt0r wants to merge 4 commits into
home-assistant:devfrom
tr4nt0r:smtp_options
Open

Add OptionsFlow to SMTP integration#173386
tr4nt0r wants to merge 4 commits into
home-assistant:devfrom
tr4nt0r:smtp_options

Conversation

@tr4nt0r

@tr4nt0r tr4nt0r commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Proposed change

Adds an options flow to the SMTP integration that reintroduces the debug and timeout parameters that were previously available in YAML configuration but omitted in the transition to UI config. The Import flow has been adjusted to import the parameters to options.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds an options flow to the SMTP integration in Home Assistant, moving the debug and timeout settings from config entry data to config entry options. This allows users to modify these settings through the UI without needing to recreate the config entry.

Changes:

  • Added OptionsFlowHandler class and OPTIONS_SCHEMA to config_flow.py for managing debug/timeout options
  • Updated import flow and __init__.py to store and read debug/timeout from entry.options instead of entry.data
  • Updated tests and fixtures to reflect the new options structure

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
homeassistant/components/smtp/config_flow.py Adds options flow handler, options schema, and updates import logic to separate options from data
homeassistant/components/smtp/init.py Spreads entry.options into discovery info passed to notification service
homeassistant/components/smtp/notify.py Reads CONF_DEBUG from discovery_info instead of using hardcoded default
homeassistant/components/smtp/strings.json Adds UI strings for the options flow fields
tests/components/smtp/conftest.py Updates mock config entry fixture with options dict
tests/components/smtp/test_config_flow.py Adds test for the options flow
tests/components/smtp/test_init.py Updates import tests to verify options are stored separately

Comment thread homeassistant/components/smtp/__init__.py
Comment thread homeassistant/components/smtp/config_flow.py
Copilot AI review requested due to automatic review settings June 9, 2026 17:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Comment thread homeassistant/components/smtp/config_flow.py Outdated
@home-assistant

home-assistant Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant Bot marked this pull request as draft June 9, 2026 20:28
Copilot AI review requested due to automatic review settings June 9, 2026 22:02
@tr4nt0r tr4nt0r marked this pull request as ready for review June 9, 2026 22:05
@home-assistant home-assistant Bot requested a review from erwindouna June 9, 2026 22:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread homeassistant/components/smtp/__init__.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants