mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 09:59:13 -05:00
27 lines
780 B
C#
27 lines
780 B
C#
using JetBrains.Annotations;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
using Microsoft.Extensions.Logging;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ChrisKaczor.HomeMonitor.Hub.Service.Hubs
|
|
{
|
|
[UsedImplicitly]
|
|
public class DeviceStatusHub(ILogger<DeviceStatusHub> logger) : Microsoft.AspNetCore.SignalR.Hub
|
|
{
|
|
[UsedImplicitly]
|
|
public async Task RequestLatestStatus()
|
|
{
|
|
logger.LogInformation("RequestLatestStatus");
|
|
|
|
await Clients.Others.SendAsync("RequestLatestStatus");
|
|
}
|
|
|
|
[UsedImplicitly]
|
|
public async Task SendLatestStatus(string message)
|
|
{
|
|
logger.LogInformation($"LatestStatus: {message}");
|
|
|
|
await Clients.Others.SendAsync("LatestStatus", message);
|
|
}
|
|
}
|
|
} |