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

Home Assistant Service Notification Support Added #1294

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

caronc
Copy link
Owner

@caronc caronc commented Feb 21, 2025

Description:

Related issue (if applicable): #1235

Addition of the following accepted Home Assistant URLs (allowing direct service notifications - to those that support it):

  • {schema}://{host}/{accesstoken}/{target}
  • {schema}://{host}:{port}/{accesstoken}/{target}
  • {schema}://{user}@{host}/{accesstoken}/{target}
  • {schema}://{user}@{host}:{port}/{accesstoken}/{target}
  • {schema}://{user}:{password}@{host}/{accesstoken}/{target}
  • {schema}://{user}:{password}@{host}:{port}/{accesstoken}/{target}

A target follows the following set of logic:

  • service
    • default domain is always 'notify' if one isn't detected
  • service:target
  • service:target1,target2,target3
  • domain.service
  • domain.service:target
  • domain.service:target1,target2,target3
    • targets can be comma/space separated if more hten one

You can specify more then one target by just separating it with a / (slash) on the URL... i.e:

  • hassio://hostname/long.lived.token/my_subsystem/my_subsystem2:targetA

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

Anyone can help test this source code as follows:

# 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@1235-hassio-notify-services

# Test out the changes with the following command:
apprise -t "Test Title" -b "Test Message" \
  'hassio://host/long-lived-token/service'

@caronc caronc linked an issue Feb 21, 2025 that may be closed by this pull request
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.37%. Comparing base (0553bf7) to head (5d835e0).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1294   +/-   ##
=======================================
  Coverage   99.36%   99.37%           
=======================================
  Files         159      159           
  Lines       20724    20813   +89     
  Branches     3725     3751   +26     
=======================================
+ Hits        20593    20682   +89     
  Misses        121      121           
  Partials       10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom notifications with Home Assistant
1 participant