Improve lamp names

This commit is contained in:
Sven van Heugten 2026-02-27 18:20:31 +01:00
parent 4a53489003
commit 1e313ca4ab
5 changed files with 35 additions and 35 deletions

View file

@ -150,14 +150,14 @@ type FakeHome with
member this.NonRemotelyControlledLightStates =
this.LightStates
|> Seq.filter (fun (light, _) ->
light = VardagsrumVagglampa
|| light = VardagsrumGolvlampa
|| light = BadrumTaklampa)
light = LivingRoomWallLamp
|| light = LivingRoomFloorLamp
|| light = BathroomCeilingLamp)
|> Seq.toList
member this.RemotelyControlledLightStates =
this.LightStates
|> Seq.filter (fun (light, _) -> light = VardagsrumFonsterlampa || light = SovrumNattduksbordlampa)
|> Seq.filter (fun (light, _) -> light = RightBedroomLamp || light = LeftBedroomLamp)
|> Seq.toList
member this.Label =

View file

@ -10,29 +10,29 @@ type ArbitraryNonRemotelyControlledLight =
static member Light() =
lights
|> Seq.filter (fun light ->
light = VardagsrumVagglampa
|| light = VardagsrumGolvlampa
|| light = BadrumTaklampa)
light = LivingRoomWallLamp
|| light = LivingRoomFloorLamp
|| light = BathroomCeilingLamp)
|> Gen.elements
|> Arb.fromGen
type ArbitraryLeftRemotelyControlledLight =
static member Light() =
lights
|> Seq.filter (fun light -> light = SovrumNattduksbordlampa)
|> Seq.filter (fun light -> light = LeftBedroomLamp)
|> Gen.elements
|> Arb.fromGen
type ArbitraryRightRemotelyControlledLight =
static member Light() =
lights
|> Seq.filter (fun light -> light = VardagsrumFonsterlampa)
|> Seq.filter (fun light -> light = RightBedroomLamp)
|> Gen.elements
|> Arb.fromGen
type ArbitraryRemotelyControlledLight =
static member Light() =
lights
|> Seq.filter (fun light -> light = VardagsrumFonsterlampa || light = SovrumNattduksbordlampa)
|> Seq.filter (fun light -> light = RightBedroomLamp || light = LeftBedroomLamp)
|> Gen.elements
|> Arb.fromGen

View file

@ -52,7 +52,7 @@ type NightLightTests() =
&& time <= endOfAlarm
let scaledForAlarm light brightness =
if (light = VardagsrumFonsterlampa || light = SovrumNattduksbordlampa) && alarm then
if (light = RightBedroomLamp || light = LeftBedroomLamp) && alarm then
float brightness * ((time - startOfDay) / (endOfAlarm - startOfDay)) |> byte
else
brightness
@ -109,10 +109,10 @@ type NightLightTests() =
let allOff (ls: (Light * LightState) seq) = ls |> Seq.forall (snd >> _.IsOff)
let controlledByLeft ls =
ls |> Seq.filter (fun (light, _) -> light = SovrumNattduksbordlampa)
ls |> Seq.filter (fun (light, _) -> light = LeftBedroomLamp)
let controlledByRight ls =
ls |> Seq.filter (fun (light, _) -> light = VardagsrumFonsterlampa)
ls |> Seq.filter (fun (light, _) -> light = RightBedroomLamp)
let maybeLastRemoteInteraction = tryGetLastRemoteInteraction interactions