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

[Pushsafer] Improve configuration to use named parameters #629

Merged
merged 13 commits into from
Mar 13, 2023

Conversation

amotl
Copy link
Member

@amotl amotl commented Mar 12, 2023

Hi,

following the rationale provided at GH-628, this would be my proposal to improve the Pushsafer configuration snippet to use named parameters instead of a list, which is confusing, and barely maintainable and extendable.

Documentation

Visit the rendered version of the reworked mqttwarn » Pushsafer service.

Configuration snippet

A valid configuration for Pushsafer in the v2 layout would be:

[config:pushsafer]
; https://www.pushsafer.com/en/pushapi
; https://www.pushsafer.com/en/pushapi_ext
targets = {
    'basic': { 'private_key': '3SAz1a2iTYsh19eXIMiO' },
    'nagios': {
        'private_key': '3SAz1a2iTYsh19eXIMiO',
        'device': '52|65|78',
        'icon': 64,
        'sound': 2,
        'vibration': 1,
        'url': 'http://example.org',
        'url_title': 'Example Org',
        'time_to_live': 60,
        'priority': 2,
        'retry': 60,
        'expire': 600,
        'answer': 1,
        },
    'tracking': {
        'private_key': '3SAz1a2iTYsh19eXIMiO',
        'device': 'gs23',
        'icon': 18,
        },
    'bogus': { 'foo': 'bar' },
    }

With kind regards,
Andreas.

/cc @appzer

@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2023

Codecov Report

Merging #629 (d9c9efb) into main (142b79e) will increase coverage by 1.03%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #629      +/-   ##
==========================================
+ Coverage   40.93%   41.97%   +1.03%     
==========================================
  Files          83       83              
  Lines        3750     3817      +67     
==========================================
+ Hits         1535     1602      +67     
  Misses       2215     2215              
Flag Coverage Δ
unittests 41.97% <100.00%> (+1.03%) ⬆️

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/pushsafer.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

tests/etc/better-addresses.ini Outdated Show resolved Hide resolved
mqttwarn/services/pushsafer.py Outdated Show resolved Hide resolved
@appzer
Copy link
Contributor

appzer commented Mar 12, 2023

@amotl do you also add the 3 new parameter (cr, ao, af) to your rework? Thanks Kevin

@amotl
Copy link
Member Author

amotl commented Mar 12, 2023

Do you also add the 3 new parameter (cr, ao, af) to your rework?

They will be added separately, based on the patch GH-630 you've submitted. Thanks.

@amotl amotl requested a review from sumnerboy12 March 12, 2023 23:48
@amotl amotl marked this pull request as ready for review March 12, 2023 23:48
@amotl
Copy link
Member Author

amotl commented Mar 13, 2023

Hi again. GH-630 has been adjusted accordingly. Let's see if @jpmens or @sumnerboy12 will have any objections about both patches.

@amotl amotl changed the title [WIP] [Pushsafer] Improve configuration to use named parameters [Pushsafer] Improve configuration to use named parameters Mar 13, 2023
Copy link
Collaborator

@sumnerboy12 sumnerboy12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to be a significant improvement.

@amotl amotl merged commit f9207eb into main Mar 13, 2023
@amotl amotl deleted the amo/improve-pushsafer branch March 13, 2023 00:27
@amotl amotl restored the amo/improve-pushsafer branch March 13, 2023 00:28
@amotl amotl deleted the amo/improve-pushsafer branch April 11, 2023 22:00
@amotl
Copy link
Member Author

amotl commented Apr 11, 2023

Dear Kevin,

I've just released mqttwarn 0.33.0 1, including all corresponding improvements around Pushsafer. Apologies for the delay, and thanks again for your contributions.

With kind regards,
Andreas.

Footnotes

  1. https://github.com/jpmens/mqttwarn/releases/tag/0.33.0

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.

4 participants