Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow fetching Reddit user posts #124142

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

NicolasNewman
Copy link

@NicolasNewman NicolasNewman commented Aug 18, 2024

Proposed change

  • Adds an additional configuration option to the Reddit integration to allow fetching Redditor comments/posts

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 Ruff (ruff format 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.

To help with the load of incoming pull requests:

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

Hi @NicolasNewman

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

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.

@MartinHjelmare MartinHjelmare changed the title Reddit Integration: allow fetching user posts Allow fetching Reddit user posts Aug 20, 2024
Copy link
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

We no longer allow integrations to add or change a platform YAML configuration.

More information on this can be found in Architecture Decision Record:

Please note that this integration connects to a device or service and another Architecture Decision Record applies that disallows the use of YAML configuration in favor of a configuration flow via the UI:

See our developer documentation on how to get started creating a configuration flow for this integration:

https://developers.home-assistant.io/docs/config_entries_config_flow_handler

As these changes often involve a bit of work and some significant shift in the current code, we will close this PR for now.

We (and our community!) would really appreciate it if you could start on the refactoring of this integration in a new PR.

Thanks already! 👍

@home-assistant home-assistant bot marked this pull request as draft September 8, 2024 10:26
@NicolasNewman
Copy link
Author

@joostlek I'll work on a separate PR that adds a config flow and hopefully have it opened by the end of this week.

@joostlek
Copy link
Member

joostlek commented Sep 9, 2024

Let me know if you need any help :)

@NicolasNewman
Copy link
Author

A bit caught up with other obligations at the moment. The config flow is complete but I need to finish the unit tests.

@joostlek
Copy link
Member

Awesome!

@NicolasNewman
Copy link
Author

NicolasNewman commented Sep 20, 2024

I switched the dependency the integration uses from praw to asyncpraw for asynchronous capabilities. There's a dependency resolution issue that prevents asyncpraw from being added to the requirements. I've opened an issue (praw-dev/asyncpraw#284) on their repo where they've mentioned prioritizing a release with the fix. I'll put this on hold for a week to see if it can be released by then.

@joostlek
Copy link
Member

Async sounds awesome. Can we migrate the current integration to be async before we add the flow? Otherwise the PR scope gets too big

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.

2 participants