From 05263fed2b2ceb32b405468e1f2bb5f402a172e1 Mon Sep 17 00:00:00 2001 From: Mats Rauhala Date: Tue, 3 Nov 2026 15:05:18 +0200 Subject: [PATCH] Easier files --- .gitignore | 2 ++ src/HomeAssistant/Runtime.hs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2a21398..ad77b1a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ dist-newstyle docs/superpowers/plans +*.dat +handlers.json *.hp *.eventlog *.eventlog.html diff --git a/src/HomeAssistant/Runtime.hs b/src/HomeAssistant/Runtime.hs index e6fd680..ebdfff5 100644 --- a/src/HomeAssistant/Runtime.hs +++ b/src/HomeAssistant/Runtime.hs @@ -42,7 +42,7 @@ import HttpServer qualified import Katip (KatipContext, Namespace (Namespace), Severity (..), logF, logLocM, ls, runKatipContextT, runKatipT, sl, katipAddNamespace) import Network.Socket (withSocketsDo) import System.Environment (getEnv, lookupEnv) -import System.FilePath (()) +import System.FilePath ((), (<.>)) import System.Metrics qualified import Text.Read (readMaybe) import UnliftIO.Async @@ -81,7 +81,7 @@ runController :: forall m. (HasCallStack, MonadCatch m, KatipContext m, MonadIO runController rootDir bus (Controller name machine) = checkpoint (Annotation name) $ katipAddNamespace ns $ do inbound <- liftIO $ atomically (dupTChan (busInbound bus)) let workerDefinition = runMealy machine (channelHassEval @m bus) - let path = rootDir T.unpack name + let path = rootDir T.unpack name <.> "dat" worker <- load path workerDefinition >>= \case Decoded a -> pure a