Update tests

This commit is contained in:
2026-09-29 20:01:03 +03:00
parent 7ad36d8ccb
commit 73d4255fd7
+7 -7
View File
@@ -5,7 +5,7 @@ module BedroomSpec (spec) where
import AFRP (Event (..), entities) import AFRP (Event (..), entities)
import qualified Data.Set as S import qualified Data.Set as S
import qualified Data.Text as T import qualified Data.Text as T
import Data.Aeson (Value) import Data.Aeson (Value, object, (.=))
import HomeAssistant.Controller import HomeAssistant.Controller
import HomeAssistant.Controller.Bedroom import HomeAssistant.Controller.Bedroom
import Support import Support
@@ -91,15 +91,15 @@ buttonSpec = describe "bedroomButtonController" $ do
it "Masse single click turns on his nightstand scene (lowest)" $ it "Masse single click turns on his nightstand scene (lowest)" $
concat (services (runHASS bedroomButtonController [masseButton "1_short_release"])) concat (services (runHASS bedroomButtonController [masseButton "1_short_release"]))
`shouldContain` [activateScene "scene.makuuhuone_masse"] `shouldContain` [activateSceneWith "scene.makuuhuone_masse" (Just $ object ["transition" .= (5 :: Int)])]
it "Masse double click turns on the middle scene" $ it "Masse double click turns on the middle scene" $
concat (services (runHASS bedroomButtonController [masseButton "1_double_press"])) concat (services (runHASS bedroomButtonController [masseButton "1_double_press"]))
`shouldContain` [activateScene "scene.makuuhuone_keski"] `shouldContain` [activateSceneWith "scene.makuuhuone_keski" (Just $ object ["transition" .= (5 :: Int)])]
it "Masse long click turns on the bright scene" $ it "Masse long click turns on the bright scene" $
concat (services (runHASS bedroomButtonController [masseButton "1_long_press"])) concat (services (runHASS bedroomButtonController [masseButton "1_long_press"]))
`shouldContain` [activateScene "scene.makuuhuone_kirkas"] `shouldContain` [activateSceneWith "scene.makuuhuone_kirkas" (Just $ object ["transition" .= (5 :: Int)])]
it "Masse off click turns the bedroom lights off" $ it "Masse off click turns the bedroom lights off" $
concat (services (runHASS bedroomButtonController [masseButton "2_short_release"])) concat (services (runHASS bedroomButtonController [masseButton "2_short_release"]))
@@ -107,15 +107,15 @@ buttonSpec = describe "bedroomButtonController" $ do
it "Enishen single click turns on her nightstand scene (lowest)" $ it "Enishen single click turns on her nightstand scene (lowest)" $
concat (services (runHASS bedroomButtonController [enishenButton "1_short_release"])) concat (services (runHASS bedroomButtonController [enishenButton "1_short_release"]))
`shouldContain` [activateScene "scene.makuuhuone_jemina"] `shouldContain` [activateSceneWith "scene.makuuhuone_jemina" (Just $ object ["transition" .= (5 :: Int)])]
it "Enishen double click turns on the middle scene" $ it "Enishen double click turns on the middle scene" $
concat (services (runHASS bedroomButtonController [enishenButton "1_double_press"])) concat (services (runHASS bedroomButtonController [enishenButton "1_double_press"]))
`shouldContain` [activateScene "scene.makuuhuone_keski"] `shouldContain` [activateSceneWith "scene.makuuhuone_keski" (Just $ object ["transition" .= (5 :: Int)])]
it "Enishen long click turns on the bright scene" $ it "Enishen long click turns on the bright scene" $
concat (services (runHASS bedroomButtonController [enishenButton "1_long_press"])) concat (services (runHASS bedroomButtonController [enishenButton "1_long_press"]))
`shouldContain` [activateScene "scene.makuuhuone_kirkas"] `shouldContain` [activateSceneWith "scene.makuuhuone_kirkas" (Just $ object ["transition" .= (5 :: Int)])]
it "Enishen off click turns the bedroom lights off" $ it "Enishen off click turns the bedroom lights off" $
concat (services (runHASS bedroomButtonController [enishenButton "2_short_release"])) concat (services (runHASS bedroomButtonController [enishenButton "2_short_release"]))