mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-02-16 10:58:32 -05:00
Add device status to hub service
This commit is contained in:
19
Hub/Service/Hubs/DeviceStatusHub.cs
Normal file
19
Hub/Service/Hubs/DeviceStatusHub.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
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 SendLatestStatus(string message)
|
||||
{
|
||||
Console.WriteLine(message);
|
||||
|
||||
await Clients.Others.SendAsync("LatestStatus", message);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user