Preserve outbound backlog across outages, fix backoff quiet period

This commit is contained in:
2026-08-20 20:12:48 +03:00
parent c030267a77
commit b3aa4c4991
4 changed files with 9 additions and 6 deletions
+2 -1
View File
@@ -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