diff --git a/src/CasaBot/CasaBotApp/Controllers/BotController.cs b/src/CasaBot/CasaBotApp/Controllers/BotController.cs index a1c1424..1391123 100644 --- a/src/CasaBot/CasaBotApp/Controllers/BotController.cs +++ b/src/CasaBot/CasaBotApp/Controllers/BotController.cs @@ -70,7 +70,7 @@ public class BotController : IController [BotCommand("/startScan", "Start a scan of last night images")] public async Task StartScan(TextMessage msg, BotCommand ctx) { - await ctx.Responder(msg, "Starting scan 🔍📼"); + await ctx.Responder(msg, "Starting scan 🔍📼 (It may take more than an hour)"); await _autoScanApp.StartNewScan(); } @@ -114,7 +114,6 @@ public class BotController : IController [BotCommand("/status", "Get the status of the alarm")] public async Task Status(TextMessage msg, BotCommand ctx) { - await ctx.Responder(msg, _controlServer.IsConnected() ? $"Alarm is connected 🟢\nLast Contact: {FormatTimeSpan(_controlServer.GetLastContactTime())} ago" : $"Alarm is not connected 🔴\nLast Contact: {FormatTimeSpan(_controlServer.GetLastContactTime())} ago"); diff --git a/src/CasaBot/ControlServer/ControlServer.cs b/src/CasaBot/ControlServer/ControlServer.cs index e4310da..9aa28e3 100644 --- a/src/CasaBot/ControlServer/ControlServer.cs +++ b/src/CasaBot/ControlServer/ControlServer.cs @@ -97,11 +97,9 @@ public class ControlServer : IControlServer private readonly List _cards = new() { - new Card("1", "Card 1"), - new Card("2", "Card 2"), - new Card("3", "Card 3"), - new Card("4", "Card 4"), - new Card("5", "Card 5"), + new Card("0438768a2c6a80", "veriz Guille"), + new Card("23141f2d", "Pin Azul"), + new Card("91cf3e02", "Tarjeta Blanca") }; private void HandleUpdate(HttpListenerResponse response) { @@ -186,14 +184,14 @@ public class ControlServer : IControlServer public void AuthorizeEvent(long eventId) { - if (_events.TryGetValue(eventId, out var sensorEvent)) - { - sensorEvent.Authorization = Authorization.Authorized; - } + if (!_events.TryGetValue(eventId, out var sensorEvent)) return; + _logger.LogInformation("Authorizing event {eventId}", eventId); + sensorEvent.Authorization = Authorization.Authorized; } public void RequestDisarm() { + _logger.LogInformation("Disarm request received"); _disarmRequestPending = true; _disarmRequestTime = DateTime.Now; }