Default energy collection key should not be defined (#9710)

This commit is contained in:
Bram Kragten 2021-08-04 17:25:42 +02:00 committed by GitHub
parent 3485296e23
commit 028b799d2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ import { ConfigEntry, getConfigEntries } from "./config_entries";
import { subscribeEntityRegistry } from "./entity_registry";
import { fetchStatistics, Statistics } from "./history";
const energyCollectionKeys: string[] = [];
const energyCollectionKeys: (string | undefined)[] = [];
export const emptyFlowFromGridSourceEnergyPreference =
(): FlowFromGridSourceEnergyPreference => ({
@ -278,7 +278,7 @@ export const getEnergyDataCollection = (
return (hass.connection as any)[key];
}
energyCollectionKeys.push(options.key || "energy");
energyCollectionKeys.push(options.key);
const collection = getCollection<EnergyData>(
hass.connection,