mirror of https://github.com/caronc/apprise
OneSignal code cleanup
parent
ed04898ec4
commit
4037d8726e
|
@ -396,6 +396,7 @@ class NotifyOneSignal(NotifyBase):
|
||||||
# Define any URL parameters
|
# Define any URL parameters
|
||||||
params = {
|
params = {
|
||||||
'image': 'yes' if self.include_image else 'no',
|
'image': 'yes' if self.include_image else 'no',
|
||||||
|
'batch': 'yes' if self.batch_size > 1 else 'no',
|
||||||
}
|
}
|
||||||
|
|
||||||
# Extend our parameters
|
# Extend our parameters
|
||||||
|
@ -453,10 +454,17 @@ class NotifyOneSignal(NotifyBase):
|
||||||
'image',
|
'image',
|
||||||
NotifyOneSignal.template_args['image']['default']))
|
NotifyOneSignal.template_args['image']['default']))
|
||||||
|
|
||||||
|
# Get Batch Boolean (if set)
|
||||||
|
results['batch'] = \
|
||||||
|
parse_bool(
|
||||||
|
results['qsd'].get(
|
||||||
|
'batch',
|
||||||
|
NotifyOneSignal.template_args['batch']['default']))
|
||||||
|
|
||||||
# The API Key is stored in the hostname
|
# The API Key is stored in the hostname
|
||||||
results['apikey'] = NotifyOneSignal.unquote(results['host'])
|
results['apikey'] = NotifyOneSignal.unquote(results['host'])
|
||||||
|
|
||||||
# Get our Device IDs
|
# Get our Targets
|
||||||
results['targets'] = NotifyOneSignal.split_path(results['fullpath'])
|
results['targets'] = NotifyOneSignal.split_path(results['fullpath'])
|
||||||
|
|
||||||
# The 'to' makes it easier to use yaml configuration
|
# The 'to' makes it easier to use yaml configuration
|
||||||
|
|
|
@ -2371,6 +2371,14 @@ TEST_URLS = (
|
||||||
# Test to=
|
# Test to=
|
||||||
'instance': plugins.NotifyOneSignal,
|
'instance': plugins.NotifyOneSignal,
|
||||||
}),
|
}),
|
||||||
|
('onesignal://appid@apikey/#segment/@user/?batch=yes', {
|
||||||
|
# Test batch=
|
||||||
|
'instance': plugins.NotifyOneSignal,
|
||||||
|
}),
|
||||||
|
('onesignal://appid@apikey/#segment/@user/?batch=no', {
|
||||||
|
# Test batch=
|
||||||
|
'instance': plugins.NotifyOneSignal,
|
||||||
|
}),
|
||||||
('onesignal://templateid:appid@apikey/playerid', {
|
('onesignal://templateid:appid@apikey/playerid', {
|
||||||
# Test Template ID
|
# Test Template ID
|
||||||
'instance': plugins.NotifyOneSignal,
|
'instance': plugins.NotifyOneSignal,
|
||||||
|
|
Loading…
Reference in New Issue