Add target exclusions to service calls
Services can now carry excluded targets, encoded as target.exclude in the WebSocket payload. The children's bedroom lights-off calls skip lights labelled 'decoration'.
This commit is contained in:
1 parent
383143024a
commit
9c89504399
15 files changed
+115
-86
No files matched your search
+2
-2
@@ -40,7 +40,7 @@ spec = describe "Bus" $ do
|
||||
|
||||
it "channelHassEval writes CallService to the outbound channel" $ withTestBus $ \bus -> do
|
||||
let req = Request (UTCTime (toEnum 0) 0) utc nil "test"
|
||||
svc = Service "light" "turn_on" Nothing [EntityId "light.bedroom_masse"]
|
||||
svc = Service "light" "turn_on" Nothing [EntityId "light.bedroom_masse"] []
|
||||
runKatipContextT (busLogEnv bus) () (Namespace ["test"]) $
|
||||
channelHassEval bus (CallService req svc)
|
||||
(_, svc') <- atomically $ readTChan (busOutbound bus)
|
||||
@@ -50,7 +50,7 @@ spec = describe "Bus" $ do
|
||||
withTestFlagsBus $ \bus -> do
|
||||
setEnabled (busFlags bus) "test-handler" False
|
||||
let req = Request (UTCTime (toEnum 0) 0) utc nil "test-handler"
|
||||
svc = Service "light" "turn_on" Nothing [EntityId "light.test"]
|
||||
svc = Service "light" "turn_on" Nothing [EntityId "light.test"] []
|
||||
runKatipContextT (busLogEnv bus) () (Namespace ["test"]) $
|
||||
channelHassEval bus (CallService req svc)
|
||||
result <- timeout 1000000 $ atomically $ readTChan (busOutbound bus)
|
||||
|
||||
Reference in new issue
Block a user