salt-extensions / saltext-pushover Goto Github PK
View Code? Open in Web Editor NEWSalt Extension for interacting with Pushover
Home Page: https://salt-extensions.github.io/saltext-pushover/
License: Apache License 2.0
Salt Extension for interacting with Pushover
Home Page: https://salt-extensions.github.io/saltext-pushover/
License: Apache License 2.0
Description
When device
, retry
, priority
or expire
is not specified, the API returns an error since this extension tries to send None
values. I'm not sure when the behavior changed or if this ever worked as expected, but I have carried a custom patch for some time now.
I'll quickly fix some basic issues like this, but really think this extension needs a proper rewrite in a v2
.
Steps to Reproduce the behavior
Try to send a message without specifying one of the values.
Expected behavior
Works.
Screenshots
Crash.
Functions in this extension declare default values for all parameters, even if they are required. This results in a suboptimal interface and code layout (which needs to check for non-falsy required values).
Example:
message
is a required parameter for pushover.post_message
. It's the third positional argument though, after user
and device
, both of which are read from the configuration if unspecified. Thus one cannot simply call salt["pushover.notify"]("My message")
.
Description
Several functions in this extension take an api_version
parameter, which is completely ignored.
The (superfluous) state module exposes a sound
parameter, which is ignored.
The query
utils func exposes token
, which is ignored.
Steps to Reproduce the behavior
Set api_version
to anything and see the extension still working.
Expected behavior
Don't expose parameters which do nothing.
There is only a single API version. We don't know how a successor will be structured, so we cannot assume the module code to just work. Only the query
util func should retain the parameter for custom modules.
Description
See title.
Sorry for keeping this brief, but this is a basic functionality just not working, so not much to reproduce.
saltext-pushover/src/saltext/pushover/states/pushover.py
Lines 109 to 111 in 8b3152f
Description
See title. This causes 2 (3 if sound
is specified) API calls for each notification.
Steps to Reproduce the behavior
Use the extension.
Expected behavior
If the validation works, cache it and only revalidate infrequently.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.