Construct light list dynamically

This commit is contained in:
Sven van Heugten 2026-02-27 18:23:49 +01:00
parent 1e313ca4ab
commit 5728da8e6c

View file

@ -1,6 +1,7 @@
module NightLight.Core.Models module NightLight.Core.Models
open System open System
open FSharp.Reflection
type Message = { Topic: string; Payload: string } type Message = { Topic: string; Payload: string }
@ -76,11 +77,9 @@ let lightProps light =
Bulb = IkeaBulb } Bulb = IkeaBulb }
let lights = let lights =
[ RightBedroomLamp FSharpType.GetUnionCases typeof<Light>
LivingRoomWallLamp |> Array.map (fun case -> FSharpValue.MakeUnion(case, [||]) :?> Light)
LivingRoomFloorLamp |> Array.toList
BathroomCeilingLamp
LeftBedroomLamp ]
let remoteControlFriendlyName = DeviceFriendlyName "Fjärrkontroll" let remoteControlFriendlyName = DeviceFriendlyName "Fjärrkontroll"