Logbook: Fix for no state obj (#7191)

This commit is contained in:
Zack Barett 2020-10-02 07:57:42 -05:00 committed by Bram Kragten
parent 0164bafbf1
commit 6d3010dcc7

View File

@ -44,11 +44,12 @@ export const getLogbookData = async (
);
for (const entry of logbookData) {
if (entry.state) {
const stateObj = hass!.states[entry.entity_id!];
if (entry.state && stateObj) {
entry.message = getLogbookMessage(
hass,
entry.state,
hass!.states[entry.entity_id!],
stateObj,
computeDomain(entry.entity_id!)
);
}