Simplify tests to prepare for a more complicated remote
This commit is contained in:
parent
a4b11e1ffa
commit
6ecb6d07ac
3 changed files with 24 additions and 26 deletions
|
|
@ -6,14 +6,17 @@ open NightLight.Core.Models
|
|||
open FsToolkit.ErrorHandling
|
||||
open FSharp.Data
|
||||
|
||||
type HumanInteraction =
|
||||
| LightPoweredOn of Light
|
||||
| LightPoweredOff of Light
|
||||
type RemoteInteraction =
|
||||
| RemotePressedOnButton
|
||||
| RemotePressedOffButton
|
||||
|
||||
type HumanInteraction =
|
||||
| LightPoweredOn of Light
|
||||
| LightPoweredOff of Light
|
||||
|
||||
type Interaction =
|
||||
| HumanInteraction of HumanInteraction
|
||||
| RemoteInteraction of RemoteInteraction
|
||||
| TimeChanged of DateTime
|
||||
|
||||
type Color =
|
||||
|
|
@ -120,12 +123,12 @@ type FakeHome() =
|
|||
|> ReceivedZigbeeEvent
|
||||
|> onEventPublished.Trigger
|
||||
| HumanInteraction(LightPoweredOff light) -> friendlyNameToFakeLight[light.FriendlyName].PowerOff()
|
||||
| HumanInteraction RemotePressedOnButton ->
|
||||
| RemoteInteraction RemotePressedOnButton ->
|
||||
{ Topic = $"zigbee2mqtt/{remoteControlFriendlyName.Get}"
|
||||
Payload = @"{ ""action"": ""on"" }" }
|
||||
|> ReceivedZigbeeEvent
|
||||
|> onEventPublished.Trigger
|
||||
| HumanInteraction RemotePressedOffButton ->
|
||||
| RemoteInteraction RemotePressedOffButton ->
|
||||
{ Topic = $"zigbee2mqtt/{remoteControlFriendlyName.Get}"
|
||||
Payload = @"{ ""action"": ""off"" }" }
|
||||
|> ReceivedZigbeeEvent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue