mirror of
https://github.com/caronc/apprise.git
synced 2025-03-13 14:28:23 +01:00
bark min volume set to 0
Signed-off-by: Q01 <8140841+pb8DvwQkfRR@users.noreply.github.com>
This commit is contained in:
parent
0ad5dd81c8
commit
e3db9e6008
@ -184,7 +184,7 @@ class NotifyBark(NotifyBase):
|
|||||||
'volume': {
|
'volume': {
|
||||||
'name': _('Volume'),
|
'name': _('Volume'),
|
||||||
'type': 'int',
|
'type': 'int',
|
||||||
'min': 1,
|
'min': 0,
|
||||||
'max': 10,
|
'max': 10,
|
||||||
},
|
},
|
||||||
'click': {
|
'click': {
|
||||||
@ -272,14 +272,14 @@ class NotifyBark(NotifyBase):
|
|||||||
# Volume
|
# Volume
|
||||||
try:
|
try:
|
||||||
self.volume = int(volume) if volume is not None else None
|
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()
|
raise ValueError()
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
self.volume = None
|
self.volume = None
|
||||||
if volume is not None:
|
if volume is not None:
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
'The specified Bark volume ({}) is not valid. '
|
'The specified Bark volume ({}) is not valid. '
|
||||||
'Must be between 1 and 10', volume)
|
'Must be between 0 and 10', volume)
|
||||||
|
|
||||||
# Level
|
# Level
|
||||||
self.level = None if not level else next(
|
self.level = None if not level else next(
|
||||||
|
@ -133,8 +133,8 @@ apprise_url_tests = (
|
|||||||
# volume > 10
|
# volume > 10
|
||||||
'instance': NotifyBark,
|
'instance': NotifyBark,
|
||||||
}),
|
}),
|
||||||
('bark://192.168.0.6:8081/device_key/?level=critical&volume=0', {
|
('bark://192.168.0.6:8081/device_key/?level=critical&volume=-1', {
|
||||||
# volume < 1
|
# volume < 0
|
||||||
'instance': NotifyBark,
|
'instance': NotifyBark,
|
||||||
}),
|
}),
|
||||||
('bark://192.168.0.6:8081/device_key/?level=critical&volume=', {
|
('bark://192.168.0.6:8081/device_key/?level=critical&volume=', {
|
||||||
@ -174,4 +174,3 @@ def test_plugin_bark_urls():
|
|||||||
|
|
||||||
# Run our general tests
|
# Run our general tests
|
||||||
AppriseURLTester(tests=apprise_url_tests).run_all()
|
AppriseURLTester(tests=apprise_url_tests).run_all()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user