night-light/NightLight.Core/Models.fs
Sven van Heugten 9531dee52b Stop requiring the initial time in NightLightStateMachine
We're only fooling ourselves if we think that it's ready *right* after
construction anyway. After all, the initial state of the lights won't be
updated when the state machine is constructed.
2026-01-04 20:16:58 +01:00

53 lines
1.2 KiB
FSharp

module NightLight.Core.Models
open System
type Message = { Topic: string; Payload: string }
type Event =
| ReceivedZigbeeEvent of Message
| TimeChanged of DateTime
type ParseZigbeeEventError =
| InvalidJson
| MissingTypeField
| MissingDataField
| MissingFriendlyNameField
| InvalidTypeField
| InvalidFriendlyNameField
| UnknownType
type OnEventReceivedError =
| ParseZigbeeEventError of ParseZigbeeEventError
| TimeIsUnknown
type Room =
| Bathroom
| LivingRoom
| Bedroom
type Bulb =
| IkeaBulb
| PaulmannBulb
type Light =
{ FriendlyName: string
Room: Room
Bulb: Bulb }
let lights =
[ { FriendlyName = "Vardagsrum - Fönsterlampa"
Room = LivingRoom
Bulb = IkeaBulb }
{ FriendlyName = "Vardagsrum - Vägglampa"
Room = LivingRoom
Bulb = PaulmannBulb }
{ FriendlyName = "Vardagsrum - Golvlampa"
Room = LivingRoom
Bulb = PaulmannBulb }
{ FriendlyName = "Badrum - Taklampa"
Room = Bathroom
Bulb = IkeaBulb }
{ FriendlyName = "Sovrum - Nattduksbordlampa"
Room = Bedroom
Bulb = IkeaBulb } ]