Compare commits
2
Commits
213f9d5d2a
...
73d546395b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73d546395b | ||
|
|
a969730de1 |
No files matched your search
@@ -18,7 +18,7 @@ import Control.Concurrent.STM (atomically, dupTChan, readTChan)
|
|||||||
import Data.Aeson (Value)
|
import Data.Aeson (Value)
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import Data.Time (getCurrentTime, getCurrentTimeZone)
|
import Data.Time (getCurrentTime, getCurrentTimeZone)
|
||||||
import Data.Void (Void, absurd)
|
import Data.Void (Void)
|
||||||
import HomeAssistant.Controller (HASS, HASSEff (..))
|
import HomeAssistant.Controller (HASS, HASSEff (..))
|
||||||
import HomeAssistant.Runtime.Bus
|
import HomeAssistant.Runtime.Bus
|
||||||
import HomeAssistant.Runtime.Connection (writerAction, readerAction)
|
import HomeAssistant.Runtime.Connection (writerAction, readerAction)
|
||||||
@@ -116,10 +116,8 @@ defaultMain = withSocketsDo $ do
|
|||||||
, ("metrics", HomeAssistant.Runtime.Metrics.metricsAction store rrdPath rrdtool)
|
, ("metrics", HomeAssistant.Runtime.Metrics.metricsAction store rrdPath rrdtool)
|
||||||
, ("metrics-http", HomeAssistant.Runtime.Graphing.graphAction rrdPath rrdtool metricsPort)
|
, ("metrics-http", HomeAssistant.Runtime.Graphing.graphAction rrdPath rrdtool metricsPort)
|
||||||
] ++ [ (name, runController rootPath bus c) | c@(Controller name _ True) <- controllers ]
|
] ++ [ (name, runController rootPath bus c) | c@(Controller name _ True) <- controllers ]
|
||||||
as <- runKatipContextT (busLogEnv bus) () mempty $
|
runKatipContextT (busLogEnv bus) () mempty $
|
||||||
mapM (\(name, act) -> async (supervised name act)) workers
|
mapConcurrently_ (uncurry supervised) workers
|
||||||
(_, v) <- waitAny as
|
|
||||||
absurd v
|
|
||||||
|
|
||||||
dryRunHassEval :: Namespace -> Bus -> HASSEff a -> IO a
|
dryRunHassEval :: Namespace -> Bus -> HASSEff a -> IO a
|
||||||
dryRunHassEval ns bus = \case
|
dryRunHassEval ns bus = \case
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ trafficGraph :: GraphSpec
|
|||||||
trafficGraph =
|
trafficGraph =
|
||||||
GraphSpec
|
GraphSpec
|
||||||
{ gsName = "traffic"
|
{ gsName = "traffic"
|
||||||
, gsTitle = "Traffic"
|
, gsTitle = "Hass triggers in / services out"
|
||||||
, gsPlots =
|
, gsPlots =
|
||||||
[ Line 2 Series
|
[ Line 2 Series
|
||||||
{ serSource = Source "hass_trigger_in" Average
|
{ serSource = Source "hass_trigger_in" Average
|
||||||
|
|||||||
@@ -83,12 +83,12 @@ spec = do
|
|||||||
, "--width", "800"
|
, "--width", "800"
|
||||||
, "--height", "250"
|
, "--height", "250"
|
||||||
, "--imgformat", "PNG"
|
, "--imgformat", "PNG"
|
||||||
, "DEF:trig=hass-controller.rrd:hass_trigger_in:AVERAGE"
|
, "DEF:in_raw=hass-controller.rrd:hass_trigger_in:AVERAGE"
|
||||||
, "CDEF:trig_min=trig,60,*"
|
, "CDEF:in=in_raw,60.0,*"
|
||||||
, "DEF:svc=hass-controller.rrd:hass_service_out:AVERAGE"
|
, "DEF:out_raw=hass-controller.rrd:hass_service_out:AVERAGE"
|
||||||
, "CDEF:svc_min=svc,60,*"
|
, "CDEF:out=out_raw,60.0,*"
|
||||||
, "LINE2:trig_min#0066cc:triggers in/min"
|
, "LINE2:in#0066cc:Triggers in/min"
|
||||||
, "LINE2:svc_min#cc0000:services out/min"
|
, "LINE2:out#cc0000:Service calls out/min"
|
||||||
]
|
]
|
||||||
|
|
||||||
describe "end-to-end (rrdtool-gated)" $ do
|
describe "end-to-end (rrdtool-gated)" $ do
|
||||||
@@ -123,4 +123,4 @@ spec = do
|
|||||||
code `shouldBe` ExitSuccess
|
code `shouldBe` ExitSuccess
|
||||||
out `shouldSatisfy` BS.isPrefixOf pngMagic
|
out `shouldSatisfy` BS.isPrefixOf pngMagic
|
||||||
)
|
)
|
||||||
`finally` cleanup
|
`finally` cleanup
|
||||||
Reference in new issue
Block a user