Skip to content

Commit

Permalink
Merge pull request #57 from firstof9/bug-fixes-1
Browse files Browse the repository at this point in the history
Fixed math on delivering package count
  • Loading branch information
firstof9 authored Mar 5, 2020
2 parents 5d94782 + f4392e8 commit 0afc349
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 8 deletions.
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

0 comments on commit 0afc349

Please sign in to comment.