Improve types for remote button presses in tests

This commit is contained in:
Sven van Heugten 2026-03-15 11:33:26 +01:00
parent 3913522cc3
commit 1dc1faa16a
4 changed files with 25 additions and 27 deletions

View file

@ -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