Implement the Right button on the bedroom remote
This commit is contained in:
parent
b9fc8bfaea
commit
d3a00b8a77
5 changed files with 74 additions and 64 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue