Files
HomeMonitor/Hub/Service/Hubs/DeviceStatusHub.cs
2022-08-23 14:10:35 -04:00

27 lines
717 B
C#

using JetBrains.Annotations;
using Microsoft.AspNetCore.SignalR;
using System;
using System.Threading.Tasks;
namespace ChrisKaczor.HomeMonitor.Hub.Service.Hubs
{
[UsedImplicitly]
public class DeviceStatusHub : Microsoft.AspNetCore.SignalR.Hub
{
[UsedImplicitly]
public async Task RequestLatestStatus()
{
Console.WriteLine("RequestLatestStatus");
await Clients.Others.SendAsync("RequestLatestStatus");
}
[UsedImplicitly]
public async Task SendLatestStatus(string message)
{
Console.WriteLine($"LatestStatus: {message}");
await Clients.Others.SendAsync("LatestStatus", message);
}
}
}