Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: moralmunky/Home-Assistant-Mail-And-Packages
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.3.5-b5
Choose a base ref
...
head repository: moralmunky/Home-Assistant-Mail-And-Packages
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dev
Choose a head ref
Loading
Showing with 21,090 additions and 2,894 deletions.
  1. +1 −1 .coveragerc
  2. +4 −0 .devcontainer/README.md
  3. +0 −28 .github/ISSUE_TEMPLATE/bug_report.md
  4. +64 −0 .github/ISSUE_TEMPLATE/bug_report.yml
  5. +0 −20 .github/ISSUE_TEMPLATE/feature_request.md
  6. +17 −0 .github/ISSUE_TEMPLATE/feature_request.yml
  7. +8 −8 .github/release-drafter.yml
  8. +28 −22 .github/workflows/pytest.yaml
  9. +3 −2 .github/workflows/release.yaml
  10. +0 −1 .gitignore
  11. +4 −6 README.md
  12. +125 −97 custom_components/mail_and_packages/__init__.py
  13. +9 −54 custom_components/mail_and_packages/binary_sensor.py
  14. +17 −22 custom_components/mail_and_packages/camera.py
  15. +278 −105 custom_components/mail_and_packages/config_flow.py
  16. +651 −33 custom_components/mail_and_packages/const.py
  17. +3 −2 custom_components/mail_and_packages/diagnostics.py
  18. +14 −0 custom_components/mail_and_packages/entity.py
  19. +569 −282 custom_components/mail_and_packages/helpers.py
  20. +1 −0 custom_components/mail_and_packages/images/.PLACEHOLDER
  21. +8 −6 custom_components/mail_and_packages/manifest.json
  22. +28 −17 custom_components/mail_and_packages/sensor.py
  23. +1 −1 custom_components/mail_and_packages/services.yaml
  24. +118 −96 custom_components/mail_and_packages/strings.json
  25. +69 −49 custom_components/mail_and_packages/translations/ca.json
  26. +79 −59 custom_components/mail_and_packages/translations/de.json
  27. +63 −43 custom_components/mail_and_packages/translations/en.json
  28. +70 −50 custom_components/mail_and_packages/translations/es.json
  29. +71 −51 custom_components/mail_and_packages/translations/es_419.json
  30. +74 −54 custom_components/mail_and_packages/translations/fi.json
  31. +69 −49 custom_components/mail_and_packages/translations/fr.json
  32. +70 −50 custom_components/mail_and_packages/translations/hu.json
  33. +69 −49 custom_components/mail_and_packages/translations/it.json
  34. +74 −54 custom_components/mail_and_packages/translations/ko.json
  35. +71 −51 custom_components/mail_and_packages/translations/nl.json
  36. +69 −49 custom_components/mail_and_packages/translations/no.json
  37. +70 −50 custom_components/mail_and_packages/translations/pl.json
  38. +70 −50 custom_components/mail_and_packages/translations/pt.json
  39. +71 −51 custom_components/mail_and_packages/translations/pt_BR.json
  40. +69 −49 custom_components/mail_and_packages/translations/ru.json
  41. +123 −0 custom_components/mail_and_packages/translations/sk.json
  42. +70 −50 custom_components/mail_and_packages/translations/sl.json
  43. +70 −50 custom_components/mail_and_packages/translations/sv.json
  44. +71 −51 custom_components/mail_and_packages/translations/zh_Hant_HK.json
  45. +3 −2 hacs.json
  46. +3 −0 pylintrc
  47. +3 −2 requirements.txt
  48. +5 −1 requirements_test.txt
  49. +1 −1 setup.cfg
  50. +417 −72 tests/conftest.py
  51. +163 −3 tests/const.py
  52. +158 −20 tests/test_binary_sensor.py
  53. +32 −65 tests/test_camera.py
  54. +1,184 −613 tests/test_config_flow.py
  55. +7 −4 tests/test_diagnostics.py
  56. +619 −0 tests/test_emails/amazon_otp.eml
  57. +1,735 −0 tests/test_emails/capost_mail.eml
  58. +315 −0 tests/test_emails/evri_delivered.eml
  59. +168 −0 tests/test_emails/evri_out_for_delivery.eml
  60. +11,076 −0 tests/test_emails/new_informed_delivery.eml
  61. +1,208 −0 tests/test_emails/usps_mail_delivered.eml
  62. +0 −21 tests/test_emails/usps_out_for_delivery.eml
  63. +524 −264 tests/test_helpers.py
  64. +44 −59 tests/test_init.py
  65. +5 −1 tests/test_sensor.py
  66. +7 −4 tox.ini
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[report]
show_missing = True
fail_under = 95
fail_under = 90
4 changes: 4 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -58,3 +58,7 @@ Then launch the task `Run Home Assistant on port 9123`, and launch the debugger
with the existing debugging configuration `Python: Attach Local`.

For more information, look at [the Remote Python Debugger integration documentation](https://www.home-assistant.io/integrations/debugpy/).

If you get an error 128 when running the container, you may need to change git to use HTTPs
```git config --global url.https://github.com/.insteadOf git://github.com/```

28 changes: 0 additions & 28 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Report an issue with Mail and Packages
labels: ["pending"]
title: "[Bug]: "
description: Report an issue with Mail and Packages.
body:
- type: textarea
validations:
required: true
attributes:
label: The problem
description: >-
Describe the issue you are experiencing here, to communicate to the
maintainers. Tell us what you were trying to do and what happened.
Provide a clear and concise description of what the problem is.
- type: markdown
attributes:
value: |
## Environment
- type: input
id: version
validations:
required: true
attributes:
label: What version of Home Assistant?
placeholder: core-
description: >
Can be found in: [Settings ⇒ System ⇒ Repairs ⇒ Three Dots in Upper Right ⇒ System information](https://my.home-assistant.io/redirect/system_health/).
[![Open your Home Assistant instance and show the system information.](https://my.home-assistant.io/badges/system_health.svg)](https://my.home-assistant.io/redirect/system_health/)
- type: input
validations:
required: true
attributes:
label: What version of Mail and Packages?
description: >
Can be found in: [Settings ⇒ Devices & services ⇒ Mail and Packages under the Mail and Packages logo](https://my.home-assistant.io/redirect/integration/?domain=mail_and_packages)
[![Open your Home Assistant instance and show the integration information.](https://my.home-assistant.io/badges/integration.svg)](https://my.home-assistant.io/redirect/integration/?domain=mail_and_packages)
- type: markdown
attributes:
value: |
# Details
- type: textarea
attributes:
label: Diagnostics information
placeholder: "drag-and-drop the diagnostics data file here (do not copy-and-paste the content)"
description: >-
Many integrations provide the ability to [download diagnostic data](https://www.home-assistant.io/docs/configuration/troubleshooting/#debug-logs-and-diagnostics).
**It would really help if you could download the diagnostics data for the device you are having issues with,
and <ins>drag-and-drop that file into the textbox below.</ins>**
It generally allows pinpointing defects and thus resolving issues faster.
- type: textarea
attributes:
label: Anything in the logs that might be useful for us?
description: For example, error message, or stack traces.
render: txt
- type: textarea
attributes:
label: Additional information
description: >
If you have any additional information for us, use the field below.
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Request a feature for Mail and Packages
labels: ["feature"]
title: "[Feature Request]: "
description: Request a feature for Mail and Packages.
body:
- type: textarea
validations:
required: true
attributes:
label: The feature
description: >-
Describe the feature you'd like added.
- type: textarea
attributes:
label: Additional information
description: >
If you have any additional information for us, use the field below.
16 changes: 8 additions & 8 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -19,31 +19,31 @@ autolabeler:
title:
- "/tests:/i"
categories:
- title: ":boom: Breaking Change :boom:"
- title: "💥 Breaking Change 💥"
labels:
- "breaking-change"
- title: ":zap: Enhancements :zap:"
- title: " Enhancements "
labels:
- "enhancement"
- title: ":sparkles: New Features :sparkles:"
- title: " New Features "
labels:
- "feature"
- title: ":bug: Bug Fixes :bug:"
- title: "🐛 Bug Fixes 🐛"
labels:
- "fix"
- "bugfix"
- "bug"
- title: ":wrench: Maintenance :wrench:"
- title: "🔧 Maintenance 🔧"
labels:
- "chore"
- title: ":mortar_board: Code Quality :mortar_board:"
- title: "🎓 Code Quality 🎓"
labels:
- "code-quality"
- title: ":books: Documentation :books:"
- title: "📚 Documentation 📚"
labels:
- "documentation"
template: |
[![Downloads for this release](https://img.shields.io/github/downloads/moralmunky/Home-Assistant-Mail-And-Packages/$RESOLVED_VERSION/total.svg)](https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/releases/$RESOLVED_VERSION)
[![Downloads for this release](https://img.shields.io/github/downloads/moralmunky/Home-Assistant-Mail-And-Packages/$RESOLVED_VERSION/total)](https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/releases/$RESOLVED_VERSION)
$CHANGES
50 changes: 28 additions & 22 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,58 @@
name: Pytest

on:
push:
pull_request:
schedule:
- cron: "0 7 1-28/7 * *"
push:
branches:
- dev

jobs:
build:
runs-on: ubuntu-latest
tests:
runs-on: "ubuntu-latest"
name: Run tests
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
# - "3.10"
# - "3.11"
# - "3.12"
- "3.13"

steps:
- uses: actions/checkout@v2
- name: 📥 Checkout the repository
uses: actions/checkout@v4
- name: 🛠️ Set up Python
uses: actions/setup-python@v5
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: 📦 Install requirements
run: |
sudo apt-get update
sudo apt-get -y install language-pack-it
pip install tox tox-gh-actions
- name: Test with tox
- name: 🏃 Test with tox
run: tox
- name: Upload coverage data
uses: "actions/upload-artifact@v2.2.4"
- name: 📤 Upload coverage to Codecov
uses: "actions/upload-artifact@v4"
with:
name: coverage-data
path: "coverage.xml"

coverage:
runs-on: ubuntu-latest
needs: build
needs: tests
steps:
- name: Check out the repository
uses: actions/checkout@v2.3.4
- name: 📥 Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Download coverage data
uses: actions/download-artifact@v2.0.10
- name: 📥 Download coverage data
uses: actions/download-artifact@v4
with:
name: coverage-data
- name: Upload coverage report
uses: codecov/codecov-action@v2.0.2
- name: 📤 Upload coverage report
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
5 changes: 3 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Release

on:
workflow_dispatch:
release:
types: [published]

@@ -18,7 +19,7 @@ jobs:

- name: "Set version numbmer"
run: |
sed -i '/VERSION = /c\VERSION = "${{ steps.get_version.outputs.VERSION }}"' ${{ github.workspace }}/custom_components/mail_and_packages/const.py
sed -i '/\bVERSION\b = /c\VERSION = "${{ steps.get_version.outputs.VERSION }}"' ${{ github.workspace }}/custom_components/mail_and_packages/const.py
sed -i '/version/c\ \"version\": \"${{ steps.get_version.outputs.VERSION }}\"' ${{ github.workspace }}/custom_components/mail_and_packages/manifest.json
# Pack the mail_and_packages dir as a zip and upload to the release
- name: ZIP MnP Dir
@@ -32,4 +33,4 @@ jobs:
file: ${{ github.workspace }}/custom_components/mail_and_packages/mail_and_packages.zip
asset_name: mail_and_packages.zip
tag: ${{ github.ref }}
overwrite: true
overwrite: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ custom_components/mail_and_packages/.backup/__init__.py
custom_components/mail_and_packages/.backup/camera.py
custom_components/mail_and_packages/.backup/manifest.json
custom_components/mail_and_packages/.backup/sensor.py
custom_components/mail_and_packages/images/*
notes.txt

# Test files
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
![GitHub](https://img.shields.io/github/license/moralmunky/Home-Assistant-Mail-And-Packages)
![GitHub Repo stars](https://img.shields.io/github/stars/moralmunky/Home-Assistant-Mail-And-Packages)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/moralmunky/Home-Assistant-Mail-And-Packages)
[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/custom-components/hacs)
![Pytest](https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/workflows/Pytest/badge.svg?branch=master)
![CodeQL](https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/workflows/CodeQL/badge.svg?branch=master)
![Validate with hassfest](https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/workflows/Validate%20with%20hassfest/badge.svg?branch=master)
[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/hacs/integration)
![Pytest](https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/workflows/Pytest/badge.svg?branch=dev)
![CodeQL](https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/workflows/CodeQL/badge.svg?branch=dev)

![GitHub contributors](https://img.shields.io/github/contributors/moralmunky/Home-Assistant-Mail-And-Packages)
![Maintenance](https://img.shields.io/maintenance/yes/2022)
![GitHub commit activity](https://img.shields.io/github/commit-activity/y/moralmunky/Home-Assistant-Mail-And-Packages)
![GitHub commits since tagged version](https://img.shields.io/github/commits-since/moralmunky/Home-Assistant-Mail-And-Packages/0.3.3-2/dev)
![GitHub last commit](https://img.shields.io/github/last-commit/moralmunky/Home-Assistant-Mail-And-Packages/dev)
![Codecov branch](https://img.shields.io/codecov/c/github/moralmunky/Home-Assistant-Mail-And-Packages/master)
![Codecov branch](https://img.shields.io/codecov/c/github/moralmunky/Home-Assistant-Mail-And-Packages/dev)

## About Mail and Packages integration

Loading