mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-13 17:22:54 -05:00
Fix models in environment service and add more SignalR messaging
This commit is contained in:
2
Hub/Service/.vscode/launch.json
vendored
2
Hub/Service/.vscode/launch.json
vendored
@@ -9,7 +9,7 @@
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
"program": "${workspaceFolder}/bin/Debug/net5.0/ChrisKaczor.HomeMonitor.Hub.Service.dll",
|
||||
"program": "${workspaceFolder}/bin/Debug/net8.0/ChrisKaczor.HomeMonitor.Hub.Service.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"stopAtEntry": false,
|
||||
|
||||
@@ -9,11 +9,19 @@ namespace ChrisKaczor.HomeMonitor.Hub.Service.Hubs
|
||||
public class EnvironmentHub(ILogger<EnvironmentHub> logger) : Microsoft.AspNetCore.SignalR.Hub
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public async Task SendMessage(string message)
|
||||
public async Task SendLatest(string message)
|
||||
{
|
||||
logger.LogInformation(message);
|
||||
|
||||
await Clients.Others.SendAsync("Message", message);
|
||||
await Clients.Others.SendAsync("Latest", message);
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
public async Task RequestLatest()
|
||||
{
|
||||
logger.LogInformation("RequestLatest");
|
||||
|
||||
await Clients.Others.SendAsync("RequestLatest");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user