diff --git a/src/graphEntry.ts b/src/graphEntry.ts index 0d9cdb7..47e285d 100644 --- a/src/graphEntry.ts +++ b/src/graphEntry.ts @@ -222,10 +222,8 @@ export default class GraphEntry { const newStateHistory: EntityCachePoints = newHistory[0].map((item) => { let currentState: unknown = null; if (this._config.attribute) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - if (item.attributes && item.attributes![this._config.attribute]) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - currentState = item.attributes![this._config.attribute]; + if (item.attributes && item.attributes[this._config.attribute] !== undefined) { + currentState = item.attributes[this._config.attribute]; } } else { currentState = item.state; diff --git a/src/types.ts b/src/types.ts index cf7ab78..c5dbb07 100644 --- a/src/types.ts +++ b/src/types.ts @@ -53,7 +53,8 @@ export interface HassHistoryEntry { last_updated: string; state: string; last_changed: string; - attributes?: never; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + attributes?: any; } export interface HistoryBucket {