-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathhttp.ts
More file actions
29 lines (25 loc) · 789 Bytes
/
http.ts
File metadata and controls
29 lines (25 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import type { HomeAssistant } from "../types";
export interface HttpConfig {
server_host?: string[];
server_port?: number;
ssl_certificate?: string;
ssl_peer_certificate?: string;
ssl_key?: string;
cors_allowed_origins?: string[];
use_x_forwarded_for?: boolean;
trusted_proxies?: string[];
use_x_frame_options?: boolean;
ip_ban_enabled?: boolean;
login_attempts_threshold?: number;
ssl_profile?: "modern" | "intermediate";
}
interface HttpConfigResponse {
config: HttpConfig;
}
export const fetchHttpConfig = (hass: HomeAssistant) =>
hass.callWS<HttpConfigResponse>({ type: "http/config/get" });
export const saveHttpConfig = (hass: HomeAssistant, config: HttpConfig) =>
hass.callWS<HttpConfigResponse>({
type: "http/config/update",
config,
});