Drop period if invalid

This commit is contained in:
Erik 2022-09-21 15:41:40 +02:00 committed by Bram Kragten
parent 726ed32626
commit e31d1aace0
No known key found for this signature in database
GPG Key ID: FBE2DFDB363EF55B

View File

@ -94,6 +94,12 @@ export class HuiStatisticsGraphCardEditor
this.hass!,
statisticIds || []
);
if (statisticIds?.some((statistic_id) => statistic_id.includes(":"))) {
const { period, ...config } = this._config!;
fireEvent(this, "config-changed", {
config: config,
});
}
};
public willUpdate(changedProps: PropertyValues) {