Skip to content

Commit

Permalink
bark min volume set to 0
Browse files Browse the repository at this point in the history
Signed-off-by: Q01 <[email protected]>
  • Loading branch information
pb8DvwQkfRR committed Nov 21, 2024
1 parent 0ad5dd8 commit e3db9e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions apprise/plugins/bark.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class NotifyBark(NotifyBase):
'volume': {
'name': _('Volume'),
'type': 'int',
'min': 1,
'min': 0,
'max': 10,
},
'click': {
Expand Down Expand Up @@ -272,14 +272,14 @@ def __init__(self, targets=None, include_image=True, sound=None,
# 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(
Expand Down
5 changes: 2 additions & 3 deletions test/test_plugin_bark.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
# 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=', {
Expand Down Expand Up @@ -174,4 +174,3 @@ def test_plugin_bark_urls():

# Run our general tests
AppriseURLTester(tests=apprise_url_tests).run_all()

0 comments on commit e3db9e6

Please sign in to comment.