Update hui-graph-header-footer.ts (#10476)

This commit is contained in:
Carlos Garcia Saura 2021-12-02 22:32:38 +01:00 committed by GitHub
parent 251416b51d
commit 60ce805b3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -193,21 +193,13 @@ export class HuiGraphHeaderFooter
this._stateHistory!.push(...stateHistory[0]);
}
const limits =
this._config!.limits === undefined &&
this._stateHistory?.some(
(entity) => entity.attributes?.unit_of_measurement === "%"
)
? { min: 0, max: 100 }
: this._config!.limits;
this._coordinates =
coordinates(
this._stateHistory,
this._config!.hours_to_show!,
500,
this._config!.detail!,
limits
this._config!.limits
) || [];
this._date = endTime;