diff --git a/NightLight.Core/Models.fs b/NightLight.Core/Models.fs index 20f9b24..e7bfdf9 100644 --- a/NightLight.Core/Models.fs +++ b/NightLight.Core/Models.fs @@ -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 + |> Array.map (fun case -> FSharpValue.MakeUnion(case, [||]) :?> Light) + |> Array.toList let remoteControlFriendlyName = DeviceFriendlyName "FjÀrrkontroll"