Add power hub

This commit is contained in:
2019-10-12 17:26:26 -04:00
parent 83d6e38637
commit 5c3901951e
2 changed files with 20 additions and 0 deletions

View 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 PowerHub : Microsoft.AspNetCore.SignalR.Hub
{
[UsedImplicitly]
public async Task SendLatestSample(string message)
{
Console.WriteLine(message);
await Clients.Others.SendAsync("LatestSample", message);
}
}
}

View File

@@ -32,6 +32,7 @@ namespace ChrisKaczor.HomeMonitor.Hub.Service
applicationBuilder.UseEndpoints(endpoints =>
{
endpoints.MapHub<WeatherHub>("/weather");
endpoints.MapHub<PowerHub>("/power");
endpoints.MapDefaultControllerRoute();
});
}