Skip to content

Commit

Permalink
test coverage resolved; volume init reworked
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Nov 30, 2024
1 parent e3db9e6 commit 1ce1981
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions apprise/plugins/bark.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,14 @@ def __init__(self, targets=None, include_image=True, sound=None,
'The specified Bark sound ({}) was not found ', sound)

# Volume
try:
self.volume = int(volume) if volume is not None else None
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.volume = None
if volume is not None:
try:
self.volume = int(volume) if volume is not None else None
if self.volume is not None and not (0 <= self.volume <= 10):
raise ValueError()

except (TypeError, ValueError):
self.logger.warning(
'The specified Bark volume ({}) is not valid. '
'Must be between 0 and 10', volume)
Expand Down

0 comments on commit 1ce1981

Please sign in to comment.