Initial setup of environment service

This commit is contained in:
2024-01-13 21:20:09 -05:00
parent bacc7c1c67
commit b5f2a6b535
22 changed files with 892 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 EnvironmentHub : Microsoft.AspNetCore.SignalR.Hub
{
[UsedImplicitly]
public async Task SendLatestReading(string message)
{
Console.WriteLine(message);
await Clients.Others.SendAsync("LatestReading", message);
}
}
}

View File

@@ -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();
});
}