fix: send all status messages with ClientId

This commit is contained in:
Andrew Welker
2025-10-30 15:57:15 -05:00
parent afcddad1cc
commit fd40b0c6d1
2 changed files with 5 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ namespace PepperDash.Essentials.Touchpanel
return; return;
} }
AddAction($"/fullStatus", (id, context) => SendFullStatus()); AddAction($"/fullStatus", (id, context) => SendFullStatus(id));
AddAction($"/openApp", (id, context) => _appControl.OpenApp()); AddAction($"/openApp", (id, context) => _appControl.OpenApp());

View File

@@ -1,6 +1,7 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Core.Logging;
using PepperDash.Essentials.AppServer; using PepperDash.Essentials.AppServer;
using PepperDash.Essentials.AppServer.Messengers; using PepperDash.Essentials.AppServer.Messengers;
@@ -29,17 +30,17 @@ namespace PepperDash.Essentials.Touchpanel
{ {
AddAction("/fullStatus", (id, content) => AddAction("/fullStatus", (id, content) =>
{ {
PostStatusMessage(new ThemeUpdateMessage { Theme = _tpDevice.Theme }); PostStatusMessage(new ThemeUpdateMessage { Theme = _tpDevice.Theme }, id);
}); });
AddAction("/saveTheme", (id, content) => AddAction("/saveTheme", (id, content) =>
{ {
var theme = content.ToObject<MobileControlSimpleContent<string>>(); var theme = content.ToObject<MobileControlSimpleContent<string>>();
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Setting theme to {theme}", this, theme.Value); this.LogInformation("Setting theme to {theme}", this, theme.Value);
_tpDevice.UpdateTheme(theme.Value); _tpDevice.UpdateTheme(theme.Value);
PostStatusMessage(JToken.FromObject(new { theme = theme.Value })); PostStatusMessage(JToken.FromObject(new { theme = theme.Value }), id);
}); });
} }
} }