Skip to content

Add config flow to imap#74623

Merged
MartinHjelmare merged 14 commits into
home-assistant:devfrom
engrbm87:imap-config-flow
Jan 9, 2023
Merged

Add config flow to imap#74623
MartinHjelmare merged 14 commits into
home-assistant:devfrom
engrbm87:imap-config-flow

Conversation

@engrbm87
Copy link
Copy Markdown
Contributor

@engrbm87 engrbm87 commented Jul 7, 2022

Breaking change

The Imap integration migrated to configuration via the UI. Configuring Imap via YAML configuration has been deprecated and will be removed in a future Home Assistant release.

Your existing YAML configuration is automatically imported on upgrade to this release; and thus can be safely removed from your YAML configuration after upgrading.

Proposed change

  • Add configuration flow for imap integration.
  • Import config from sensor platform.
  • Add tests.

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)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • 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
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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 link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant probot-home-assistant Bot added config-flow This integration migrates to the UI by adding a config flow has-tests integration: imap labels Jul 7, 2022
@engrbm87 engrbm87 marked this pull request as ready for review July 26, 2022 09:55
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 9, 2022

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@github-actions github-actions Bot added the stale label Nov 9, 2022
@MartinHjelmare
Copy link
Copy Markdown
Member

Please solve the merge conflict.

Comment thread homeassistant/components/imap/__init__.py Outdated
Comment thread homeassistant/components/imap/__init__.py Outdated
Comment thread homeassistant/components/imap/__init__.py Outdated
Comment thread homeassistant/components/imap/config_flow.py Outdated
Comment thread homeassistant/components/imap/config_flow.py Outdated
Comment thread homeassistant/components/imap/__init__.py Outdated
Comment thread homeassistant/components/imap/config_flow.py Outdated
Comment thread homeassistant/components/imap/coordinator.py Outdated
Comment thread homeassistant/components/imap/sensor.py Outdated
Comment thread homeassistant/components/imap/sensor.py Outdated
Comment thread homeassistant/components/imap/strings.json Outdated
Comment thread homeassistant/components/imap/sensor.py Outdated
@MartinHjelmare
Copy link
Copy Markdown
Member

MartinHjelmare commented Dec 20, 2022

A future improvement of this integration could be to fire a custom event when a new email arrives. Then we could deprecate the imap_email_content integration.

https://www.home-assistant.io/integrations/imap_email_content/

Comment thread homeassistant/components/imap/coordinator.py Outdated
Comment thread homeassistant/components/imap/__init__.py Outdated
Comment thread homeassistant/components/imap/coordinator.py Outdated
Comment thread homeassistant/components/imap/coordinator.py Outdated
Comment thread homeassistant/components/imap/coordinator.py Outdated
Comment thread homeassistant/components/imap/coordinator.py Outdated
Comment thread homeassistant/components/imap/coordinator.py Outdated
Comment thread homeassistant/components/imap/coordinator.py Outdated
Comment thread homeassistant/components/imap/sensor.py Outdated
Comment thread homeassistant/components/imap/sensor.py
Comment thread homeassistant/components/imap/sensor.py Outdated
@MartinHjelmare MartinHjelmare added deprecation Indicates a breaking change to happen in the future docs-missing labels Jan 6, 2023
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Looks good!

@MartinHjelmare
Copy link
Copy Markdown
Member

Ping me when you've linked a docs PR and I'll merge.

@engrbm87
Copy link
Copy Markdown
Contributor Author

engrbm87 commented Jan 9, 2023

Ping me when you've linked a docs PR and I'll merge.

Done. Thanks for the support on this one.

@MartinHjelmare
Copy link
Copy Markdown
Member

Thanks!

@MartinHjelmare MartinHjelmare merged commit a0e1805 into home-assistant:dev Jan 9, 2023
shbatm pushed a commit to shbatm/home-assistant-core that referenced this pull request Jan 9, 2023
* Add config flow to imap

fix coverage

fix config_flows.py

* move coordinator to seperate file, remove name key

* update intrgations.json

* update requirements_all.txt

* fix importing issue_registry

* Address comments

* Improve handling exceptions on intial connection

* exit loop tasks properly

* fix timeout

* revert async_timeout

* Improve entity update handling

* ensure we wait for idle to finish

* fix typing

* Update deprecation period

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 10, 2023
@jbouwh
Copy link
Copy Markdown
Contributor

jbouwh commented Mar 24, 2023

A future improvement of this integration could be to fire a custom event when a new email arrives. Then we could deprecate the imap_email_content integration.

https://www.home-assistant.io/integrations/imap_email_content/

@MartinHjelmare With a custom event, can the user use the data, or is it only possible to filter an event with the data?

@MartinHjelmare
Copy link
Copy Markdown
Member

I don't understand what you mean with:

can the user use the data, or is it only possible to filter an event with the data

@jbouwh
Copy link
Copy Markdown
Contributor

jbouwh commented Mar 24, 2023

Found this https://www.home-assistant.io/integrations/template/#turning-an-event-into-a-trigger-based-binary-sensor
If we would use a custom event that sends the data, it should be possible to use the data of the event.

@MartinHjelmare
Copy link
Copy Markdown
Member

Yes, the trigger data is available in the template.

https://www.home-assistant.io/docs/automation/templating/#event

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed config-flow This integration migrates to the UI by adding a config flow deprecation Indicates a breaking change to happen in the future has-tests integration: imap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants