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

Add custom sound support to pushover #843

Merged
merged 4 commits into from
Jul 1, 2023
Merged

Add custom sound support to pushover #843

merged 4 commits into from
Jul 1, 2023

Conversation

cdkl
Copy link
Contributor

@cdkl cdkl commented Feb 27, 2023

Description:

Pushover integration constrains notification sounds to a predefined list. This change adds support for custom sound in notifications, which must be uploaded and given a name. This change updates the pushover integration to allow for that name to be specified instead of throwing an error.

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use flake8)
  • 100% test coverage

Testing

(I performed these steps)

  1. Go to Settings -> Alert Settings -> Manage custom sounds -> Upload a sound
  2. Upload a sound and specify a name (e.g. "mysound").
  3. Validate the sound is accessible and present in the sounds list for your app via https://api.pushover.net/1/sounds.json?token={app-token}
  4. Specify a sound in your pover call, i.e. apprise -vv -t "title" -b "test message" pover://user@app?sound=mysound

You should hear your custom sound on the notification. In cases where the custom sound name is not found, the default pushover notification sound will play.

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@<this.branch-name>

# Test out the changes with the following command:
apprise -t "Test Title" -b "Test Message" \
  <apprise url related to ticket>

Pushover integration constrains notification sounds to a predefined list. This change adds support for custom sound in notifications, which must be uploaded and given a name. This change updates the pushover integration to allow for that name to be specified instead of throwing an error.

Test plan (I performed these steps)
1. Go to Settings -> Alert Settings -> Manage custom sounds -> Upload a sound
2. Upload a sound and specify a name (e.g. "mysound").
3. Validate the sound is accessible and present in the sounds list for your app via https://api.pushover.net/1/sounds.json?token={app-token}
4. Specify a sound in your pover call, i.e. apprise -vv -t "title" -b "test message" pover://user@app?sound=mysound

You should hear your custom sound on the notification. In cases where the custom sound name is not found, the default pushover notification sound will play.
@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.02 ⚠️

Comparison is base (6458ab0) 100.00% compared to head (ea5e095) 99.98%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff             @@
##            master     #843      +/-   ##
===========================================
- Coverage   100.00%   99.98%   -0.02%     
===========================================
  Files          118      118              
  Lines        15356    15692     +336     
  Branches      3146     3207      +61     
===========================================
+ Hits         15356    15690     +334     
- Misses           0        1       +1     
- Partials         0        1       +1     
Impacted Files Coverage Δ
apprise/plugins/NotifyPushover.py 100.00% <100.00%> (ø)

... and 65 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@caronc caronc merged commit f1d0e9b into caronc:master Jul 1, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants