mirror of
https://github.com/excaliburpartners/OmniLinkBridge
synced 2025-05-06 17:13:11 +00:00

- Restructured code to be event based with modules - Added MQTT module for Home Assistant - Added pushover notifications - Added web service API subscriptions file to persist subscriptions
24 lines
683 B
C#
24 lines
683 B
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace OmniLinkBridge.Notifications
|
|
{
|
|
public static class Notification
|
|
{
|
|
private static readonly List<INotification> providers = new List<INotification>()
|
|
{
|
|
new EmailNotification(),
|
|
new ProwlNotification(),
|
|
new PushoverNotification()
|
|
};
|
|
|
|
public static void Notify(string source, string description, NotificationPriority priority = NotificationPriority.Normal)
|
|
{
|
|
Parallel.ForEach(providers, (provider) =>
|
|
{
|
|
provider.Notify(source, description, priority);
|
|
});
|
|
}
|
|
}
|
|
}
|