From 52bcf29b830eb9c7c535a77671a490b3d910ef96 Mon Sep 17 00:00:00 2001 From: Zanna_37 <> Date: Sat, 19 Nov 2022 14:17:56 +0100 Subject: [PATCH] fix: correctly set the default for `extend_to_present` --- src/plotly-graph-card.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plotly-graph-card.ts b/src/plotly-graph-card.ts index 525b67e..c9e73b4 100644 --- a/src/plotly-graph-card.ts +++ b/src/plotly-graph-card.ts @@ -368,8 +368,7 @@ export class PlotlyGraph extends HTMLElement { null; if (colorScheme === null) { throw new Error( - `color_scheme: "${ - config.color_scheme + `color_scheme: "${config.color_scheme }" is not valid. Valid are an array of colors (see readme) or ${Object.keys( colorSchemes )}` @@ -454,8 +453,8 @@ export class PlotlyGraph extends HTMLElement { throw new Error( `period: "${entity.period}" is not valid. Use ${STATISTIC_PERIODS}` ); - entity.extend_to_present ??= !entity.statistic; } + entity.extend_to_present ??= !entity.statistic; const [oldAPI_entity, oldAPI_attribute] = entity.entity.split("::"); if (oldAPI_attribute) { entity.entity = oldAPI_entity;