Skip to content

Add paperless integration #145239

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

Merged
merged 41 commits into from
May 22, 2025
Merged

Conversation

fvgarrel
Copy link
Contributor

@fvgarrel fvgarrel commented May 19, 2025

Breaking change

Proposed change

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.

@home-assistant home-assistant bot marked this pull request as draft May 19, 2025 19:06
@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.

@fvgarrel fvgarrel marked this pull request as ready for review May 21, 2025 18:44
@home-assistant home-assistant bot requested a review from zweckj May 21, 2025 18:44
Copy link
Contributor

@autinerd autinerd left a comment

Choose a reason for hiding this comment

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

Very cool integration!

@home-assistant home-assistant bot marked this pull request as draft May 21, 2025 19:53
@zweckj
Copy link
Member

zweckj commented May 21, 2025

oh and you'll need to update your snapshots because of the stateclass change

@fvgarrel fvgarrel marked this pull request as ready for review May 21, 2025 22:01
@home-assistant home-assistant bot requested review from zweckj, autinerd and joostlek May 21, 2025 22:01
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.

Last nits from my side

Comment on lines +49 to +53
paperless.statistics = AsyncMock(
return_value=Statistic.create_with_data(
paperless, data=mock_statistic_data, fetched=True
)
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
paperless.statistics = AsyncMock(
return_value=Statistic.create_with_data(
paperless, data=mock_statistic_data, fetched=True
)
)
paperless.statistics.return_value = Statistic.create_with_data(
paperless, data=mock_statistic_data, fetched=True
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already asked yesterday:

paperless.statistics.return_value = Statistic.create_with_data(
    paperless, data=mock_statistic_data, fetched=True
)

This does not work for me: FAILED tests/components/paperless_ngx/test_sensor.py::test__statistic_sensor_state_on_error[PaperlessInvalidTokenError] - AttributeError: Mock object has no attribute 'statistics'

Have I forgot something?

Copy link
Member

Choose a reason for hiding this comment

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

Josef just messaged me about this one, didn't see what you responded, I will check

Copy link
Member

Choose a reason for hiding this comment

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

Oh I see how you did this, I think it could be because of the __call__ structure you have, inthat case I think its fine

Comment on lines +57 to +58
mock_paperless.statistics = AsyncMock(
return_value=Statistic.create_with_data(
Copy link
Member

Choose a reason for hiding this comment

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

Same

Comment on lines +99 to +101
# recover from error
mock_paperless.statistics = AsyncMock(
return_value=Statistic.create_with_data(
Copy link
Member

Choose a reason for hiding this comment

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

Same

@joostlek joostlek dismissed edenhaus’s stale review May 22, 2025 08:38

sensor platform it is

@joostlek joostlek merged commit 9a8c29e into home-assistant:dev May 22, 2025
43 of 44 checks passed
@joostlek
Copy link
Member

Please send me a message on discord so we can add you to the right channels :D

@fvgarrel fvgarrel deleted the add-paperless-integration branch May 22, 2025 10:55
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy