From fcaccfdeb0c3cd80cee658ef71f84da328eb6caa Mon Sep 17 00:00:00 2001 From: Mats Rauhala Date: Tue, 29 Sep 2026 20:42:14 +0300 Subject: [PATCH] Faster transition --- src/HomeAssistant/Controller/Bedroom.hs | 4 ++-- test/BedroomSpec.hs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/HomeAssistant/Controller/Bedroom.hs b/src/HomeAssistant/Controller/Bedroom.hs index 62bebe3..2cd76a5 100644 --- a/src/HomeAssistant/Controller/Bedroom.hs +++ b/src/HomeAssistant/Controller/Bedroom.hs @@ -62,7 +62,7 @@ bedroomPresenceController = proc x -> do callService (activateSceneWith "scene.makuuhuone_lepotila" transition) -< () _ -> returnA -< () where - transition = Just $ object ["transition" .= (10 :: Int)] + transition = Just $ object ["transition" .= (1:: Int)] data BedroomControls @@ -103,7 +103,7 @@ bedroomButtonController = proc x -> do callService (light [AreaId "makuuhuone"] Off) -< () _ -> returnA -< () where - transition = Just $ object ["transition" .= (5 :: Int)] + transition = Just $ object ["transition" .= (1 :: Int)] diff --git a/test/BedroomSpec.hs b/test/BedroomSpec.hs index 38656ab..66d0a3a 100644 --- a/test/BedroomSpec.hs +++ b/test/BedroomSpec.hs @@ -91,15 +91,15 @@ buttonSpec = describe "bedroomButtonController" $ do it "Masse single click turns on his nightstand scene (lowest)" $ concat (services (runHASS bedroomButtonController [masseButton "1_short_release"])) - `shouldContain` [activateSceneWith "scene.makuuhuone_masse" (Just $ object ["transition" .= (5 :: Int)])] + `shouldContain` [activateSceneWith "scene.makuuhuone_masse" (Just $ object ["transition" .= (1 :: Int)])] it "Masse double click turns on the middle scene" $ concat (services (runHASS bedroomButtonController [masseButton "1_double_press"])) - `shouldContain` [activateSceneWith "scene.makuuhuone_keski" (Just $ object ["transition" .= (5 :: Int)])] + `shouldContain` [activateSceneWith "scene.makuuhuone_keski" (Just $ object ["transition" .= (1 :: Int)])] it "Masse long click turns on the bright scene" $ concat (services (runHASS bedroomButtonController [masseButton "1_long_press"])) - `shouldContain` [activateSceneWith "scene.makuuhuone_kirkas" (Just $ object ["transition" .= (5 :: Int)])] + `shouldContain` [activateSceneWith "scene.makuuhuone_kirkas" (Just $ object ["transition" .= (1 :: Int)])] it "Masse off click turns the bedroom lights off" $ 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)" $ concat (services (runHASS bedroomButtonController [enishenButton "1_short_release"])) - `shouldContain` [activateSceneWith "scene.makuuhuone_jemina" (Just $ object ["transition" .= (5 :: Int)])] + `shouldContain` [activateSceneWith "scene.makuuhuone_jemina" (Just $ object ["transition" .= (1 :: Int)])] it "Enishen double click turns on the middle scene" $ concat (services (runHASS bedroomButtonController [enishenButton "1_double_press"])) - `shouldContain` [activateSceneWith "scene.makuuhuone_keski" (Just $ object ["transition" .= (5 :: Int)])] + `shouldContain` [activateSceneWith "scene.makuuhuone_keski" (Just $ object ["transition" .= (1 :: Int)])] it "Enishen long click turns on the bright scene" $ concat (services (runHASS bedroomButtonController [enishenButton "1_long_press"])) - `shouldContain` [activateSceneWith "scene.makuuhuone_kirkas" (Just $ object ["transition" .= (5 :: Int)])] + `shouldContain` [activateSceneWith "scene.makuuhuone_kirkas" (Just $ object ["transition" .= (1 :: Int)])] it "Enishen off click turns the bedroom lights off" $ concat (services (runHASS bedroomButtonController [enishenButton "2_short_release"]))