lucasheld / uptime-kuma-api

A Python wrapper for the Uptime Kuma Socket.IO API
https://uptime-kuma-api.readthedocs.io
MIT License
273 stars 23 forks source link

Support for a new notification type? #14

Closed openstep closed 1 year ago

openstep commented 1 year ago

Hi,

I forked Uptime Kuma to be able to add a new notification type (custom to our setup). We have build an API pod based on your code that talks to Uptime Kuma. Now I need to adjust the API pod to support the new notification type. I would like to know if you could extend the code so that I do not have to fork your project too? If rather not extend it, that is totally understandable.

I could send you what is new in Uptime Kuma. Basically this new notification type is a copy of the notif. type SMTP with added parameters and a set template in it so it will send an XML email (taking values added in in the UI).

Thx

lucasheld commented 1 year ago

Currently I have no plans to make adjustments so that custom notifications can be added at runtime.

But you only need to change one file. Example for the notification type Kook:

Add the notification type to the NotificationType enum: https://github.com/lucasheld/uptime-kuma-api/blob/cc48b688da2f395224ad95c91ec1857668b8fa4a/uptime_kuma_api/notification_providers.py#L142-L143

Add the notification options with the corresponding type to the notification_provider_options dict: https://github.com/lucasheld/uptime-kuma-api/blob/cc48b688da2f395224ad95c91ec1857668b8fa4a/uptime_kuma_api/notification_providers.py#L389-L392