diff --git a/apprise/plugins/NotifyOneSignal.py b/apprise/plugins/NotifyOneSignal.py index 03d9d40a..3d936f5b 100644 --- a/apprise/plugins/NotifyOneSignal.py +++ b/apprise/plugins/NotifyOneSignal.py @@ -396,6 +396,7 @@ class NotifyOneSignal(NotifyBase): # Define any URL parameters params = { 'image': 'yes' if self.include_image else 'no', + 'batch': 'yes' if self.batch_size > 1 else 'no', } # Extend our parameters @@ -453,10 +454,17 @@ class NotifyOneSignal(NotifyBase): 'image', 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 results['apikey'] = NotifyOneSignal.unquote(results['host']) - # Get our Device IDs + # Get our Targets results['targets'] = NotifyOneSignal.split_path(results['fullpath']) # The 'to' makes it easier to use yaml configuration diff --git a/test/test_rest_plugins.py b/test/test_rest_plugins.py index 5393b519..197c0507 100644 --- a/test/test_rest_plugins.py +++ b/test/test_rest_plugins.py @@ -2371,6 +2371,14 @@ TEST_URLS = ( # Test to= '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', { # Test Template ID 'instance': plugins.NotifyOneSignal,