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
|
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"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue