Add more info to system log (#4899)

* Add more info to system log

* Add util, oops

* Tweak UI
This commit is contained in:
Paulus Schoutsen
2020-02-17 10:20:24 -08:00
committed by GitHub
parent 46a596ce34
commit 322eef1c0f
6 changed files with 102 additions and 26 deletions

View File

@@ -1,6 +1,7 @@
import { HomeAssistant } from "../types";
export interface LoggedError {
name: string;
message: string;
level: string;
source: string;
@@ -14,3 +15,8 @@ export interface LoggedError {
export const fetchSystemLog = (hass: HomeAssistant) =>
hass.callApi<LoggedError[]>("GET", "error/all");
export const getLoggedErrorIntegration = (item: LoggedError) =>
item.name.startsWith("homeassistant.components.")
? item.name.split(".")[2]
: undefined;