Logbook: Fix for no state obj (#7191)

This commit is contained in:
Zack Barett 2020-10-02 07:57:42 -05:00 committed by GitHub
parent 93d1b9a2d5
commit cbdfaccdb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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!)
);
}