Preserve outbound backlog across outages, fix backoff quiet period
This commit is contained in:
+2
-1
@@ -3,7 +3,7 @@ module RuntimeSpec (spec) where
|
||||
|
||||
import Control.Concurrent (threadDelay)
|
||||
import Control.Concurrent.Async (async)
|
||||
import Control.Concurrent.STM (atomically, readTChan, writeTChan)
|
||||
import Control.Concurrent.STM (atomically, isEmptyTChan, readTChan, writeTChan)
|
||||
import Data.Aeson (Value, object, (.=))
|
||||
import Data.Text (Text)
|
||||
import HomeAssistant.Controller (light, lightController)
|
||||
@@ -24,6 +24,7 @@ spec = describe "runController" $ do
|
||||
svc2 <- atomically (readTChan (busOutbound bus))
|
||||
svc1 `shouldBe` light True
|
||||
svc2 `shouldBe` light False
|
||||
atomically (isEmptyTChan (busOutbound bus)) `shouldReturn` True
|
||||
|
||||
doorEvent :: Text -> Value
|
||||
doorEvent state = object
|
||||
|
||||
Reference in New Issue
Block a user