Improve types for remote button presses in tests
This commit is contained in:
parent
3913522cc3
commit
1dc1faa16a
4 changed files with 25 additions and 27 deletions
|
|
@ -36,17 +36,13 @@ let doesLightHavePowerAfterInteractions light interactions =
|
|||
|> Seq.tryLast
|
||||
|> Option.defaultValue false
|
||||
|
||||
let tryGetLastBedroomRemoteInteraction interactions =
|
||||
let tryGetLastBedroomControllingRemoteInteraction interactions =
|
||||
interactions
|
||||
|> Seq.indexed
|
||||
|> Seq.choose (fun (index, interaction) ->
|
||||
match interaction with
|
||||
| Interaction.RemoteInteraction remoteInteraction ->
|
||||
match remoteInteraction with
|
||||
| RemotePressedOnButton
|
||||
| RemotePressedOffButton
|
||||
| RemotePressedLeftButton -> Some(index, remoteInteraction)
|
||||
| RemotePressedRightButton -> None
|
||||
| Interaction.BedroomControllingRemoteInteraction bedroomRemoteInteraction ->
|
||||
Some(index, bedroomRemoteInteraction)
|
||||
| _ -> None)
|
||||
|> Seq.tryLast
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue