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