feat(bark): Add 'call' parameter support to NotifyBark for ringtones (#1444)

This commit is contained in:
HerbertGao
2025-11-16 02:34:22 +08:00
committed by GitHub
parent dfe933cbb4
commit 2774bf071c
2 changed files with 34 additions and 0 deletions

View File

@@ -213,6 +213,11 @@ class NotifyBark(NotifyBase):
"name": _("Icon URL"),
"type": "string",
},
"call": {
"name": _("Call"),
"type": "bool",
"default": False,
},
},
)
@@ -228,6 +233,7 @@ class NotifyBark(NotifyBase):
badge=None,
volume=None,
icon=None,
call=None,
**kwargs,
):
"""Initialize Notify Bark Object."""
@@ -306,6 +312,9 @@ class NotifyBark(NotifyBase):
volume,
)
# Call
self.call = parse_bool(call)
# Icon URL
self.icon = icon if isinstance(icon, str) else None
@@ -388,6 +397,9 @@ class NotifyBark(NotifyBase):
if self.volume:
payload["volume"] = self.volume
if self.call:
payload["call"] = 1
auth = None
if self.user:
auth = (self.user, self.password)
@@ -502,6 +514,9 @@ class NotifyBark(NotifyBase):
if self.icon:
params["icon"] = self.icon
if self.call:
params["call"] = "yes"
# Extend our parameters
params.update(self.url_parameters(privacy=privacy, *args, **kwargs))
@@ -608,4 +623,9 @@ class NotifyBark(NotifyBase):
results["qsd"]["icon"].strip()
)
# Call
results["call"] = parse_bool(
results["qsd"].get("call", False)
)
return results

View File

@@ -254,6 +254,20 @@ apprise_url_tests = (
"instance": NotifyBark,
},
),
(
"bark://192.168.0.6:8081/device_key/?call=1",
{
# set call parameter to repeat ringtone
"instance": NotifyBark,
},
),
(
"bark://192.168.0.6:8081/device_key/?call=1&sound=alarm&level=critical",
{
# set call parameter with other parameters
"instance": NotifyBark,
},
),
)