Construct light list dynamically
This commit is contained in:
parent
1e313ca4ab
commit
5728da8e6c
1 changed files with 4 additions and 5 deletions
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue