mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-21 18:13:04 +00:00
* Add UI to set/update core config * Types * Disable editor in config.yaml mode * Fix type
26 lines
608 B
TypeScript
26 lines
608 B
TypeScript
import { HomeAssistant } from "../types";
|
|
import { HassConfig } from "home-assistant-js-websocket";
|
|
|
|
export interface ConfigUpdateValues {
|
|
location_name: string;
|
|
latitude: number;
|
|
longitude: number;
|
|
elevation: number;
|
|
unit_system: "metric" | "imperial";
|
|
time_zone: string;
|
|
}
|
|
|
|
export const saveCoreConfig = (
|
|
hass: HomeAssistant,
|
|
values: Partial<ConfigUpdateValues>
|
|
) =>
|
|
hass.callWS<HassConfig>({
|
|
type: "config/core/update",
|
|
...values,
|
|
});
|
|
|
|
export const detectCoreConfig = (hass: HomeAssistant) =>
|
|
hass.callWS<Partial<ConfigUpdateValues>>({
|
|
type: "config/core/detect",
|
|
});
|