From 982c37045aafa4f7d7ac14bb3f1a46bd930b2eda Mon Sep 17 00:00:00 2001 From: lucasheld Date: Wed, 4 Jan 2023 22:46:12 +0100 Subject: [PATCH] feat: add support for uptime kuma 1.19.3 --- README.md | 2 +- run_tests.sh | 2 +- uptime_kuma_api/docstrings.py | 8 +++++++- uptime_kuma_api/notification_providers.py | 15 ++++++++++++++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6f2f7d6..58af2f3 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This package was developed to configure Uptime Kuma with Ansible. The Ansible co Python version 3.6+ is required. -Supported Uptime Kuma versions: 1.17.0 - 1.19.2 +Supported Uptime Kuma versions: 1.17.0 - 1.19.3 Installation --- diff --git a/run_tests.sh b/run_tests.sh index 6591ab0..e8204af 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -5,7 +5,7 @@ if [ $version ] then versions=("$version") else - versions=(1.19.2 1.18.5 1.17.1) + versions=(1.19.3 1.18.5 1.17.1) fi for version in ${versions[*]} diff --git a/uptime_kuma_api/docstrings.py b/uptime_kuma_api/docstrings.py index ae22a76..4b60e6a 100644 --- a/uptime_kuma_api/docstrings.py +++ b/uptime_kuma_api/docstrings.py @@ -58,6 +58,7 @@ def monitor_docstring(mode) -> str: :param str, optional radiusCallingStationId: Calling Station Id. Identifier of the calling device., defaults to None """ + def notification_docstring(mode) -> str: return f""" :param str{", optional" if mode == "edit" else ""} name: Friendly Name @@ -206,7 +207,7 @@ def notification_docstring(mode) -> str: :param str, optional ntfypassword: Notification option for ``type`` :attr:`~.NotificationType.NTFY` :param str, optional ntfytopic: Notification option for ``type`` :attr:`~.NotificationType.NTFY` :param int, optional ntfyPriority: Notification option for ``type`` :attr:`~.NotificationType.NTFY` - :param int, optional ntfyIcon: Notification option for ``type`` :attr:`~.NotificationType.NTFY` + :param str, optional ntfyIcon: Notification option for ``type`` :attr:`~.NotificationType.NTFY` :param str, optional ntfyserverurl: Notification option for ``type`` :attr:`~.NotificationType.NTFY` :param bool, optional smseagleEncoding: Notification option for ``type`` :attr:`~.NotificationType.SMSEAGLE`. True to send messages in unicode. :param int, optional smseaglePriority: Notification option for ``type`` :attr:`~.NotificationType.SMSEAGLE`. Message priority (0-9, default = 0). @@ -214,8 +215,12 @@ def notification_docstring(mode) -> str: :param str, optional smseagleToken: Notification option for ``type`` :attr:`~.NotificationType.SMSEAGLE`. API Access token. :param str, optional smseagleRecipient: Notification option for ``type`` :attr:`~.NotificationType.SMSEAGLE`. Recipient(s) (multiple must be separated with comma). :param str, optional smseagleUrl: Notification option for ``type`` :attr:`~.NotificationType.SMSEAGLE`. Your SMSEagle device URL. + :param str, optional webhookUrl: Notification option for ``type`` :attr:`~.NotificationType.ZOHOCLIQ` + :param str, optional kookGuildID: Notification option for ``type`` :attr:`~.NotificationType.KOOK` + :param str, optional kookBotToken: Notification option for ``type`` :attr:`~.NotificationType.KOOK` """ + def proxy_docstring(mode) -> str: return f""" :param ProxyProtocol{", optional" if mode == "edit" else ""} protocol: Proxy Protocol @@ -229,6 +234,7 @@ def proxy_docstring(mode) -> str: :param bool, optional applyExisting: Apply on all existing monitors, defaults to False """ + def docker_host_docstring(mode) -> str: return f""" :param str{", optional" if mode == "edit" else ""} name: Friendly Name diff --git a/uptime_kuma_api/notification_providers.py b/uptime_kuma_api/notification_providers.py index 7963623..a8a08f5 100644 --- a/uptime_kuma_api/notification_providers.py +++ b/uptime_kuma_api/notification_providers.py @@ -136,6 +136,12 @@ class NotificationType(str, Enum): SMSEAGLE = "SMSEagle" """SMSEagle""" + ZOHOCLIQ = "ZohoCliq" + """ZohoCliq""" + + KOOK = "Kook" + """Kook""" + notification_provider_options = { NotificationType.ALERTA: dict( @@ -376,7 +382,14 @@ notification_provider_options = { smseagleToken=dict(type="str"), smseagleRecipient=dict(type="str"), smseagleUrl=dict(type="str") - ) + ), + NotificationType.ZOHOCLIQ: dict( + webhookUrl=dict(type="str") + ), + NotificationType.KOOK: dict( + kookGuildID=dict(type="str"), + kookBotToken=dict(type="str") + ), } notification_provider_conditions = dict(