mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-13 17:22:54 -05:00
Initial setup of environment service
This commit is contained in:
19
Hub/Service/Hubs/EnvironmentHub.cs
Normal file
19
Hub/Service/Hubs/EnvironmentHub.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 EnvironmentHub : Microsoft.AspNetCore.SignalR.Hub
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public async Task SendLatestReading(string message)
|
||||
{
|
||||
Console.WriteLine(message);
|
||||
|
||||
await Clients.Others.SendAsync("LatestReading", message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ namespace ChrisKaczor.HomeMonitor.Hub.Service
|
||||
endpoints.MapHub<WeatherHub>("/weather");
|
||||
endpoints.MapHub<PowerHub>("/power");
|
||||
endpoints.MapHub<DeviceStatusHub>("/device-status");
|
||||
endpoints.MapHub<EnvironmentHub>("/environment");
|
||||
endpoints.MapDefaultControllerRoute();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user