From e792a57cb4fc67b6356e38575e7d4030a7288b17 Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Mon, 5 Jan 2026 22:06:18 +0100 Subject: [PATCH] Improve error for unknown topics --- NightLight.Core/Models.fs | 2 +- NightLight.Core/ZigbeeEvents.fs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NightLight.Core/Models.fs b/NightLight.Core/Models.fs index 363f085..5243bcb 100644 --- a/NightLight.Core/Models.fs +++ b/NightLight.Core/Models.fs @@ -9,7 +9,7 @@ type Event = | TimeChanged of DateTime type ParseZigbeeEventError = - | UnknownTopic + | UnknownTopic of string | InvalidJson | MissingTypeField | MissingDataField diff --git a/NightLight.Core/ZigbeeEvents.fs b/NightLight.Core/ZigbeeEvents.fs index 0c31a63..632c6b1 100644 --- a/NightLight.Core/ZigbeeEvents.fs +++ b/NightLight.Core/ZigbeeEvents.fs @@ -37,5 +37,5 @@ let parseZigbeeEvent (message: Message) = | Some(JsonValue.String "off") -> Ok(ButtonPress PressedOff) | Some _ -> Error InvalidActionField | None -> Error MissingActionField - | _ -> return! Error UnknownTopic + | _ -> return! Error <| UnknownTopic message.Topic }