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

Fixed math on delivering package count #57

Merged
merged 5 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## Breaking change
<!--
If your PR contains a breaking change for existing users, it is important
to tell them what breaks, how to make it work again and why we did this.
This piece of text is published with the release notes, so it helps if you
write it towards our users, not us.
Note: Remove this section if this PR is NOT a breaking change.
-->


## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->


## Type of change
<!--
What type of change does your PR introduce?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->

- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] 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
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->

- This PR fixes or closes issue: fixes #
- This PR is related to issue:
19 changes: 11 additions & 8 deletions custom_components/mail_and_packages/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,27 @@ def update(self):
# Tally emails and generate mail images
self._usps_mail = get_mails(account, self._img_out_path,
self._gif_duration)
self._usps_delivering = get_count(account, USPS_Packages_Email,
USPS_Delivering_Subject)
self._usps_delivered = get_count(account, USPS_Packages_Email,
USPS_Delivered_Subject)
self._usps_delivering = (get_count(account, USPS_Packages_Email,
USPS_Delivering_Subject) -
self._usps_delivered)
self._usps_packages = self._usps_delivering + self._usps_delivered
self._ups_delivered = get_count(account, UPS_Email,
UPS_Delivered_Subject)
self._ups_delivering = (get_count(account, UPS_Email,
UPS_Delivering_Subject) +
self._ups_delivering = ((get_count(account, UPS_Email,
UPS_Delivering_Subject) +
get_count(account, UPS_Email,
UPS_Delivering_Subject_2))
UPS_Delivering_Subject_2)) -
self._ups_delivered)
self._ups_packages = self._ups_delivered + self._ups_delivering
self._fedex_delivered = get_count(account, FEDEX_Email,
FEDEX_Delivered_Subject)
self._fedex_delivering = (get_count(account, FEDEX_Email,
FEDEX_Delivering_Subject) +
self._fedex_delivering = ((get_count(account, FEDEX_Email,
FEDEX_Delivering_Subject) +
get_count(account, FEDEX_Email,
FEDEX_Delivering_Subject_2))
FEDEX_Delivering_Subject_2)) -
self._fedex_delivered)
self._fedex_packages = (self._fedex_delivered +
self._fedex_delivering)
self._packages_transit = (self._fedex_delivering +
Expand Down