Severity level

This commit is contained in:
2026-08-21 13:55:22 +03:00
parent a77b85b576
commit c60508fd0c
4 changed files with 21 additions and 18 deletions
+3 -3
View File
@@ -14,12 +14,12 @@ import Data.Time (UTCTime (..))
import Data.UUID (nil)
import HomeAssistant.Controller (HASSEff (..), Service (..), Target(..))
import HomeAssistant.Runtime.Bus
import Katip (Namespace (Namespace), runKatipContextT)
import Katip (Namespace (Namespace), runKatipContextT, Severity (..))
import Test.Hspec
spec :: Spec
spec = describe "Bus" $ do
it "broadcasts inbound messages to every dup'd channel in order" $ withBus $ \bus -> do
it "broadcasts inbound messages to every dup'd channel in order" $ withBus InfoS $ \bus -> do
p1 <- atomically $ dupTChan (busInbound bus)
p2 <- atomically $ dupTChan (busInbound bus)
atomically $ writeTChan (busInbound bus) (Number 1)
@@ -29,7 +29,7 @@ spec = describe "Bus" $ do
r1 `shouldBe` (Number 1, Number 2)
r2 `shouldBe` (Number 1, Number 2)
it "channelHassEval writes CallService to the outbound channel" $ withBus $ \bus -> do
it "channelHassEval writes CallService to the outbound channel" $ withBus InfoS $ \bus -> do
let req = Request (UTCTime (toEnum 0) 0) nil
svc = Service "light" "turn_on" Nothing [EntityId "light.bedroom_masse"]
runKatipContextT (busLogEnv bus) () (Namespace ["test"]) $
+2 -1
View File
@@ -10,10 +10,11 @@ import HomeAssistant.Controller (light, lightController, Target (..))
import HomeAssistant.Runtime (Controller (..), runController)
import HomeAssistant.Runtime.Bus
import Test.Hspec
import Katip (Severity(..))
spec :: Spec
spec = describe "runController" $ do
it "feeds inbound events through the machine and forwards service calls" $ withBus $ \bus -> do
it "feeds inbound events through the machine and forwards service calls" $ withBus InfoS $ \bus -> do
_ <- async (runController bus (Controller "test" lightController True))
putStrLn "Before the delay"
threadDelay 100000 -- let the controller dup its inbound channel