From 1ce198135506edaff7f54c0e32c8ebfcb4264a55 Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Sat, 30 Nov 2024 18:40:46 -0500 Subject: [PATCH] test coverage resolved; volume init reworked --- apprise/plugins/bark.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/apprise/plugins/bark.py b/apprise/plugins/bark.py index 1653a91a0..c9f1fedef 100644 --- a/apprise/plugins/bark.py +++ b/apprise/plugins/bark.py @@ -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)