Read hostname from env
This commit is contained in:
@@ -65,8 +65,9 @@ runController bus (Controller name machine _enabled) = do
|
||||
defaultMain :: IO ()
|
||||
defaultMain = withSocketsDo $ withBus $ \bus -> do
|
||||
token <- getEnv "HA_TOKEN"
|
||||
host <- getEnv "HA_HOST"
|
||||
let workers =
|
||||
[ ("reader", readerAction "last-resort-redux" 8123 token bus)
|
||||
[ ("reader", readerAction host 8123 token bus)
|
||||
, ("writer", writerAction bus)
|
||||
] ++ [ (name, runController bus c) | c@(Controller name _ True) <- controllers ]
|
||||
as <- mapM (\(name, act) -> async (supervised name defaultBackoff act)) workers
|
||||
|
||||
Reference in New Issue
Block a user