From e3db9e6008b97efb0e5ffecc2ba988991c54c880 Mon Sep 17 00:00:00 2001 From: Q01 <8140841+pb8DvwQkfRR@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:05:49 +0800 Subject: [PATCH] bark min volume set to 0 Signed-off-by: Q01 <8140841+pb8DvwQkfRR@users.noreply.github.com> --- apprise/plugins/bark.py | 6 +++--- test/test_plugin_bark.py | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apprise/plugins/bark.py b/apprise/plugins/bark.py index 839018e6..1653a91a 100644 --- a/apprise/plugins/bark.py +++ b/apprise/plugins/bark.py @@ -184,7 +184,7 @@ class NotifyBark(NotifyBase): 'volume': { 'name': _('Volume'), 'type': 'int', - 'min': 1, + 'min': 0, 'max': 10, }, 'click': { @@ -272,14 +272,14 @@ class NotifyBark(NotifyBase): # Volume try: self.volume = int(volume) if volume is not None else None - if self.volume is not None and not (1 <= self.volume <= 10): + if self.volume is not None and not (0 <= self.volume <= 10): raise ValueError() except (TypeError, ValueError): self.volume = None if volume is not None: self.logger.warning( 'The specified Bark volume ({}) is not valid. ' - 'Must be between 1 and 10', volume) + 'Must be between 0 and 10', volume) # Level self.level = None if not level else next( diff --git a/test/test_plugin_bark.py b/test/test_plugin_bark.py index fc81189b..9f818c30 100644 --- a/test/test_plugin_bark.py +++ b/test/test_plugin_bark.py @@ -133,8 +133,8 @@ apprise_url_tests = ( # volume > 10 'instance': NotifyBark, }), - ('bark://192.168.0.6:8081/device_key/?level=critical&volume=0', { - # volume < 1 + ('bark://192.168.0.6:8081/device_key/?level=critical&volume=-1', { + # volume < 0 'instance': NotifyBark, }), ('bark://192.168.0.6:8081/device_key/?level=critical&volume=', { @@ -174,4 +174,3 @@ def test_plugin_bark_urls(): # Run our general tests AppriseURLTester(tests=apprise_url_tests).run_all() -