Skip to content

Migrate imap_email_content integration to config entry#89707

Closed
jbouwh wants to merge 5 commits into
home-assistant:devfrom
jbouwh:imap_email_content-config-flow
Closed

Migrate imap_email_content integration to config entry#89707
jbouwh wants to merge 5 commits into
home-assistant:devfrom
jbouwh:imap_email_content-config-flow

Conversation

@jbouwh
Copy link
Copy Markdown
Contributor

@jbouwh jbouwh commented Mar 14, 2023

Proposed change

Migrate imap_email_content integration to config entry.
The existing sensor items from configuration.yaml will be migrated to config entries automatically.
Users need to remove the configuration from configuration.yaml after the migration.
In issue was added for the yaml deprecation.

Advise is to merge #89563 first, as this fixes some bugs.

The codeowner list in the manifest was updated.

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

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
  • I have followed the perfect PR recommendations
  • 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.

To help with the load of incoming pull requests:

@home-assistant home-assistant Bot added 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_email_content Quality Scale: No score labels Mar 14, 2023
@jbouwh jbouwh marked this pull request as ready for review March 14, 2023 19:06
@MartinHjelmare
Copy link
Copy Markdown
Member

I'd suggest to deprecate this integration instead and fire an event in the imap integration that users can automate on.

#74623 (comment)

@jbouwh
Copy link
Copy Markdown
Contributor Author

jbouwh commented Mar 14, 2023

I'd suggest to deprecate this integration instead and fire an event in the imap integration that users can automate on.

#74623 (comment)

I'll have a look at that possibility

@jbouwh
Copy link
Copy Markdown
Contributor Author

jbouwh commented Mar 15, 2023

Will set this PR to draft for two reasons:

  • See if we can extend the imap integration with a custom event (see suggestion from @MartinHjelmare )
  • This PR should be split up to keep changes minimally:
    • make code owner a standalone/preliminary PR
    • move constants in a standalone/preliminary PR
    • keep option flow for a follow-up PR (to reduce the size of initial config-flow PR)
    • use self.add_suggested_values_to_schema helper to help with suggested values
    • ensure that mock_setup_entry is declared in conftest.py and auto-used in test_config_flow.py with pytestmark (see PR Move mock_setup_entry to conftest #88484)

@jbouwh jbouwh marked this pull request as draft March 15, 2023 07:32
@luca-angemi
Copy link
Copy Markdown
Contributor

Hi @jbouwh

I tested locally this integration and it works great.

I've a quick question: once a sensor is created, shouldn't the entry reflect that there is an entity belonging to it?

image

In my case it never appears.

Thanks in advance.

@jbouwh
Copy link
Copy Markdown
Contributor Author

jbouwh commented Mar 21, 2023

Hi @jbouwh

I tested locally this integration and it works great.

I've a quick question: once a sensor is created, shouldn't the entry reflect that there is an entity belonging to it?

image

In my case it never appears.

Thanks in advance.

May be it should (thnx), but for now it is not clear yet if we continue with this PT. Plans are to extend the imap integration with an event instead and deprecated this integration.

@luca-angemi
Copy link
Copy Markdown
Contributor

I've read about it, thanks. Ok, in case we go further with this please let me know if I can help with testing.

Cheers.

@jbouwh
Copy link
Copy Markdown
Contributor Author

jbouwh commented Mar 30, 2023

Superseded by #90429 and home-assistant/home-assistant.io#26792

@jbouwh jbouwh closed this Mar 30, 2023
@jbouwh jbouwh deleted the imap_email_content-config-flow branch March 30, 2023 14:46
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 31, 2023
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_email_content Quality Scale: No score

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants