From fee0a1dd8e91458fbb05daa149aeead9d544341c Mon Sep 17 00:00:00 2001 From: lucasheld Date: Tue, 4 Oct 2022 13:47:14 +0200 Subject: [PATCH] feat: add support for uptime kuma 1.18.1 / 1.18.2 --- uptime_kuma_api/notification_providers.py | 89 ++++++++++++++--------- 1 file changed, 55 insertions(+), 34 deletions(-) diff --git a/uptime_kuma_api/notification_providers.py b/uptime_kuma_api/notification_providers.py index 55ec072..3f7da9f 100644 --- a/uptime_kuma_api/notification_providers.py +++ b/uptime_kuma_api/notification_providers.py @@ -16,8 +16,6 @@ class NotificationType(str, Enum): LUNASEA = "lunasea" MATRIX = "matrix" MATTERMOST = "mattermost" - NTFY = "ntfy" - OCTOPUSH = "octopush" ONEBOT = "OneBot" PAGERDUTY = "PagerDuty" PROMOSMS = "promosms" @@ -31,15 +29,21 @@ class NotificationType(str, Enum): SLACK = "slack" SMTP = "smtp" STACKFIELD = "stackfield" - TEAMS = "teams" PUSHBYTECHULUS = "PushByTechulus" TELEGRAM = "telegram" WEBHOOK = "webhook" WECOM = "WeCom" ALERTNOW = "AlertNow" - BARK = "Bark" HOMEASSISTANT = "HomeAssistant" LINENOTIFY = "LineNotify" + BARK = "Bark" + GOALERT = "GoAlert" + NTFY = "ntfy" + OCTOPUSH = "octopush" + SERVERCHAN = "ServerChan" + SMSMANAGER = "SMSManager" + SQUADCAST = "squadcast" + TEAMS = "teams" notification_provider_options = { @@ -115,24 +119,6 @@ notification_provider_options = { "mattermosticonemo", "mattermosticonurl", ], - NotificationType.NTFY: [ - "ntfyserverurl", - "ntfytopic", - "ntfyPriority", - ], - NotificationType.OCTOPUSH: [ - "octopushVersion", - "octopushAPIKey", - "octopushLogin", - "octopushPhoneNumber", - "octopushSMSType", - "octopushSenderName", - "octopushDMLogin", - "octopushDMAPIKey", - "octopushDMPhoneNumber", - "octopushDMSenderName", - "octopushDMSMSType", - ], NotificationType.ONEBOT: [ "httpAddr", "accessToken", @@ -218,9 +204,6 @@ notification_provider_options = { NotificationType.STACKFIELD: [ "stackfieldwebhookURL", ], - NotificationType.TEAMS: [ - "webhookUrl", - ], NotificationType.PUSHBYTECHULUS: [ "pushAPIKey", ], @@ -238,11 +221,6 @@ notification_provider_options = { NotificationType.ALERTNOW: [ "alertNowWebhookURL", ], - NotificationType.BARK: [ - "barkEndpoint", - "barkGroup", - "barkSound", - ], NotificationType.HOMEASSISTANT: [ "homeAssistantUrl", "longLivedAccessToken", @@ -250,6 +228,49 @@ notification_provider_options = { NotificationType.LINENOTIFY: [ "lineNotifyAccessToken", ], + NotificationType.BARK: [ + "barkEndpoint", + "barkGroup", + "barkSound", + ], + NotificationType.GOALERT: [ + "goAlertBaseURL", + "goAlertToken", + ], + NotificationType.NTFY: [ + "ntfyusername", + "ntfypassword", + "ntfytopic", + "ntfyPriority", + "ntfyserverurl", + ], + NotificationType.OCTOPUSH: [ + "octopushVersion", + "octopushAPIKey", + "octopushLogin", + "octopushPhoneNumber", + "octopushSMSType", + "octopushSenderName", + "octopushDMLogin", + "octopushDMAPIKey", + "octopushDMPhoneNumber", + "octopushDMSenderName", + "octopushDMSMSType", + ], + NotificationType.SERVERCHAN: [ + "serverChanSendKey", + ], + NotificationType.SMSMANAGER: [ + "smsmanagerApiKey", + "numbers", + "messageType", + ], + NotificationType.SQUADCAST: [ + "squadcastWebhookURL", + ], + NotificationType.TEAMS: [ + "webhookUrl", + ], } notification_provider_conditions = { @@ -257,12 +278,12 @@ notification_provider_conditions = { "min": 0, "max": 10, }, - "ntfyPriority": { - "min": 1, - "max": 5, - }, "smtpPort": { "min": 0, "max": 65535, }, + "ntfyPriority": { + "min": 1, + "max": 5, + }, }