Skip to content

Commit 2145d47

Browse files
committed
[Pushsafer] Remove default parameter expire=3600
1 parent d98aeaa commit 2145d47

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

HANDBOOK.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2469,10 +2469,12 @@ For a list of available icons, sounds and other params see the
24692469
[Pushsafer API](https://www.pushsafer.com/en/pushapi).
24702470
24712471
Please note:
2472-
- The default value for the [_Expire_](https://www.pushsafer.com/en/pushapi_ext#API-EX)
2473-
parameter is `3600`.
2474-
2475-
- `vibration=0` means "device-default" vibration.
2472+
- [Retry](https://www.pushsafer.com/en/pushapi_ext#API-RE)
2473+
with [Expire](https://www.pushsafer.com/en/pushapi_ext#API-EX):
2474+
For configuring delivery retries, you must set both parameters.
2475+
- [Vibration](https://www.pushsafer.com/en/pushapi_ext#API-V):
2476+
`vibration=0` means "device-default" vibration. This is a special value
2477+
used by mqttwarn, it will be translated to an empty `v=` upstream parameter.
24762478
24772479
| Topic option | M/O | Description |
24782480
| ------------- | :----: | -------------------------------------- |

mqttwarn/services/pushsafer.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ def encode_v1(self):
131131
except IndexError:
132132
raise PushsaferConfigurationError(f"Pushsafer private or alias key not configured")
133133

134-
params = {
135-
'expire': 3600,
136-
}
134+
params = OrderedDict()
137135

138136
if len(addrs) > 1:
139137
params['d'] = addrs[1]
@@ -192,13 +190,9 @@ def encode_v2(self):
192190
except KeyError:
193191
raise PushsaferConfigurationError(f"Pushsafer private or alias key not configured")
194192

195-
params = {
196-
'expire': 3600,
197-
}
198-
199193
# Decode and serialize all other parameters.
200194
pp = PushsaferParameters(**addrs)
201-
params.update(pp.translated())
195+
params = pp.translated()
202196

203197
# Propagate `title` separately.
204198
if title is not None:

tests/services/pushsafer/util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ def get_reference_data(**more_data):
99
data = {
1010
"m": "⚽ Notification message ⚽",
1111
"k": "myToken",
12-
"expire": "3600",
1312
}
1413
data.update(more_data)
1514
return data

0 commit comments

Comments
 (0)