Fix picking energy sensors for gas (#14448)

This commit is contained in:
Bram Kragten 2022-11-24 15:12:20 +01:00 committed by GitHub
parent 9bae4a646d
commit 0aa2c9044a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,9 @@ import {
isExternalStatistic, isExternalStatistic,
} from "../../../../data/recorder"; } from "../../../../data/recorder";
const gasDeviceClasses = ["gas", "energy"];
const gasUnitClasses = ["volume", "energy"];
@customElement("dialog-energy-gas-settings") @customElement("dialog-energy-gas-settings")
export class DialogEnergyGasSettings export class DialogEnergyGasSettings
extends LitElement extends LitElement
@ -103,11 +106,9 @@ export class DialogEnergyGasSettings
<ha-statistic-picker <ha-statistic-picker
.hass=${this.hass} .hass=${this.hass}
.includeUnitClass=${this._params.allowedGasUnitClass || [ .includeUnitClass=${this._params.allowedGasUnitClass ||
"volume", gasUnitClasses}
"energy", .includeDeviceClass=${gasDeviceClasses}
]}
include-device-class="gas"
.value=${this._source.stat_energy_from} .value=${this._source.stat_energy_from}
.label=${`${this.hass.localize( .label=${`${this.hass.localize(
"ui.panel.config.energy.gas.dialog.gas_usage" "ui.panel.config.energy.gas.dialog.gas_usage"