// Send Raw Message public static async Task <bool> SendNotification(Notification.MessageData msg) { if (_notification == null) { _logger.LogWarning("Brain | server not started, ignore notification"); return(false); } _logger.LogDebug($"Brain | msgtype {msg.Type}"); return(await _notification.Send(msg)); }
public static async Task <bool> SendNotification(NEEONotification msg, string deviceId) { if (_notification == null) { _logger.LogWarning("Brain | server not started, ignore notification"); return(false); } string notificationKey = await _notificationMapping.GetNotificationKey(msg.UniqueDeviceId, deviceId, msg.Component); if (notificationKey != null) { _logger.LogDebug($"Brain | notificationKey {notificationKey}"); Notification.MessageData notificationData = new Notification.MessageData { Type = notificationKey, Data = msg.Value }; return(await _notification.Send(notificationData)); } return(false); }