-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
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
Add paperless integration #145239
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool integration!
oh and you'll need to update your snapshots because of the stateclass change |
There was a problem hiding this 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
paperless.statistics = AsyncMock( | ||
return_value=Statistic.create_with_data( | ||
paperless, data=mock_statistic_data, fetched=True | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | |
) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
mock_paperless.statistics = AsyncMock( | ||
return_value=Statistic.create_with_data( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
# recover from error | ||
mock_paperless.statistics = AsyncMock( | ||
return_value=Statistic.create_with_data( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
Please send me a message on discord so we can add you to the right channels :D |
Breaking change
Proposed change
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: