Skip to content

Commit d38235d

Browse files
committed
fix reading of http password and ha_key
1 parent 7c5a137 commit d38235d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

appdaemon/http.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ def __init__(self, ad: "AppDaemon", main_cfg: MainConfig) -> None:
162162
self.static_dirs = {}
163163

164164
self._process_http(self.http)
165+
if (cfg := main_cfg.http) is not None and (p := cfg.password) is not None:
166+
self.password = p.get_secret_value() # read secret directly
165167

166168
self.app_endpoints = {}
167169
self.app_routes = {}
@@ -386,7 +388,6 @@ def _process_dashboard(self, dashboard):
386388
self.setup_dashboard_routes()
387389

388390
def _process_http(self, http):
389-
self._process_arg("password", http)
390391
self._process_arg("tokens", http)
391392
self._process_arg("work_factor", http)
392393
self._process_arg("ssl_certificate", http)

appdaemon/models/config/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def auth_headers(self) -> dict:
140140
if self.token is not None:
141141
return {"Authorization": f"Bearer {self.token.get_secret_value()}"}
142142
elif self.ha_key is not None:
143-
return {"x-ha-access": self.ha_key}
143+
return {"x-ha-access": self.ha_key.get_secret_value()}
144144
raise ValueError("Home Assistant token not set")
145145

146146

0 commit comments

Comments
 (0)