Implement the Right button on the bedroom remote

This commit is contained in:
Sven van Heugten 2026-02-27 19:09:13 +01:00
parent b9fc8bfaea
commit d3a00b8a77
5 changed files with 74 additions and 64 deletions

View file

@ -8,6 +8,7 @@ type Action =
| PressedOn
| PressedOff
| PressedLeft
| PressedRight
type ZigbeeEvent =
| DeviceAnnounce of DeviceFriendlyName
@ -37,6 +38,7 @@ let parseZigbeeEvent (message: Message) =
| Some(JsonValue.String "on") -> Ok(ButtonPress PressedOn)
| Some(JsonValue.String "off") -> Ok(ButtonPress PressedOff)
| Some(JsonValue.String "arrow_left_click") -> Ok(ButtonPress PressedLeft)
| Some(JsonValue.String "arrow_right_click") -> Ok(ButtonPress PressedRight)
| Some _ -> Error InvalidActionField
| None -> Error MissingActionField
| _ -> return! Error <| UnknownTopic message.Topic