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

Improve Apprise notification machinery. Add apprise_multi plugin. #558

Merged
merged 4 commits into from
Oct 19, 2021

Conversation

amotl
Copy link
Member

@amotl amotl commented Oct 18, 2021

Hi there,

based on #557, it brings notifications using Apprise closer to what @psyciknz was requesting at #555 (comment).

The idea behind this variant is to publish messages to different Apprise plugins within a single configuration snippet, containing multiple recipients in form of regular mqttwarn targets.

A corresponding configuration snippet would look like:

[defaults]
launch    = apprise-multi

[config:apprise-multi]
; Dispatch message to multiple Apprise plugins.
module   = 'apprise_multi'
targets = {
   'demo-http'        : [ { 'baseuri':  'json://localhost:1234/mqtthook' }, { 'baseuri':  'json://daq.example.org:5555/foobar' } ],
   'demo-discord'     : [ { 'baseuri':  'discord://4174216298/JHMHI8qBe7bk2ZwO5U711o3dV_js' } ],
   'demo-mailto'      : [ {
          'baseuri':  'mailtos://smtp_username:[email protected]',
          'recipients': ['[email protected]', '[email protected]'],
          'sender': '[email protected]',
          'sender_name': 'Example Monitoring',
          } ],
   }

[apprise-multi-test]
topic    = apprise/multi/#
targets  = apprise-multi:demo-http, apprise-multi:demo-discord, apprise-multi:demo-mailto

With kind regards,
Andreas.

@amotl amotl requested review from jpmens and sumnerboy12 October 18, 2021 23:48
@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2021

Codecov Report

Merging #558 (1c7c43d) into main (b927a61) will increase coverage by 0.77%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #558      +/-   ##
==========================================
+ Coverage   28.12%   28.89%   +0.77%     
==========================================
  Files          81       83       +2     
  Lines        3677     3717      +40     
==========================================
+ Hits         1034     1074      +40     
  Misses       2643     2643              
Flag Coverage Δ
unittests 28.89% <100.00%> (+0.77%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mqttwarn/model.py 100.00% <100.00%> (ø)
mqttwarn/services/apprise.py 100.00% <100.00%> (ø)
mqttwarn/services/apprise_multi.py 100.00% <100.00%> (ø)
mqttwarn/services/apprise_single.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b927a61...1c7c43d. Read the comment docs.

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.

2 participants