mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Simplify energy settings (#13846)
This commit is contained in:
parent
5422fda990
commit
6252955bb5
@ -11,14 +11,12 @@ export const mockEnergy = (hass: MockHomeAssistant) => {
|
||||
{
|
||||
stat_energy_from: "sensor.energy_consumption_tarif_1",
|
||||
stat_cost: "sensor.energy_consumption_tarif_1_cost",
|
||||
entity_energy_from: "sensor.energy_consumption_tarif_1",
|
||||
entity_energy_price: null,
|
||||
number_energy_price: null,
|
||||
},
|
||||
{
|
||||
stat_energy_from: "sensor.energy_consumption_tarif_2",
|
||||
stat_cost: "sensor.energy_consumption_tarif_2_cost",
|
||||
entity_energy_from: "sensor.energy_consumption_tarif_2",
|
||||
entity_energy_price: null,
|
||||
number_energy_price: null,
|
||||
},
|
||||
@ -27,14 +25,12 @@ export const mockEnergy = (hass: MockHomeAssistant) => {
|
||||
{
|
||||
stat_energy_to: "sensor.energy_production_tarif_1",
|
||||
stat_compensation: "sensor.energy_production_tarif_1_compensation",
|
||||
entity_energy_to: "sensor.energy_production_tarif_1",
|
||||
entity_energy_price: null,
|
||||
number_energy_price: null,
|
||||
},
|
||||
{
|
||||
stat_energy_to: "sensor.energy_production_tarif_2",
|
||||
stat_compensation: "sensor.energy_production_tarif_2_compensation",
|
||||
entity_energy_to: "sensor.energy_production_tarif_2",
|
||||
entity_energy_price: null,
|
||||
number_energy_price: null,
|
||||
},
|
||||
@ -55,7 +51,6 @@ export const mockEnergy = (hass: MockHomeAssistant) => {
|
||||
type: "gas",
|
||||
stat_energy_from: "sensor.energy_gas",
|
||||
stat_cost: "sensor.energy_gas_cost",
|
||||
entity_energy_from: "sensor.energy_gas",
|
||||
entity_energy_price: null,
|
||||
number_energy_price: null,
|
||||
},
|
||||
|
@ -29,7 +29,6 @@ export const emptyFlowFromGridSourceEnergyPreference =
|
||||
(): FlowFromGridSourceEnergyPreference => ({
|
||||
stat_energy_from: "",
|
||||
stat_cost: null,
|
||||
entity_energy_from: null,
|
||||
entity_energy_price: null,
|
||||
number_energy_price: null,
|
||||
});
|
||||
@ -38,7 +37,6 @@ export const emptyFlowToGridSourceEnergyPreference =
|
||||
(): FlowToGridSourceEnergyPreference => ({
|
||||
stat_energy_to: "",
|
||||
stat_compensation: null,
|
||||
entity_energy_to: null,
|
||||
entity_energy_price: null,
|
||||
number_energy_price: null,
|
||||
});
|
||||
@ -68,7 +66,6 @@ export const emptyGasEnergyPreference = (): GasSourceTypeEnergyPreference => ({
|
||||
type: "gas",
|
||||
stat_energy_from: "",
|
||||
stat_cost: null,
|
||||
entity_energy_from: null,
|
||||
entity_energy_price: null,
|
||||
number_energy_price: null,
|
||||
});
|
||||
@ -93,7 +90,6 @@ export interface FlowFromGridSourceEnergyPreference {
|
||||
stat_cost: string | null;
|
||||
|
||||
// Can be used to generate costs if stat_cost omitted
|
||||
entity_energy_from: string | null;
|
||||
entity_energy_price: string | null;
|
||||
number_energy_price: number | null;
|
||||
}
|
||||
@ -105,8 +101,7 @@ export interface FlowToGridSourceEnergyPreference {
|
||||
// $ meter
|
||||
stat_compensation: string | null;
|
||||
|
||||
// Can be used to generate costs if stat_cost omitted
|
||||
entity_energy_to: string | null;
|
||||
// Can be used to generate costs if stat_compensation omitted
|
||||
entity_energy_price: string | null;
|
||||
number_energy_price: number | null;
|
||||
}
|
||||
@ -142,7 +137,6 @@ export interface GasSourceTypeEnergyPreference {
|
||||
stat_cost: string | null;
|
||||
|
||||
// Can be used to generate costs if stat_cost omitted
|
||||
entity_energy_from: string | null;
|
||||
entity_energy_price: string | null;
|
||||
number_energy_price: number | null;
|
||||
unit_of_measurement?: string | null;
|
||||
|
@ -280,7 +280,6 @@ export class DialogEnergyGasSettings
|
||||
this._source = {
|
||||
...this._source!,
|
||||
stat_energy_from: ev.detail.value,
|
||||
entity_energy_from: ev.detail.value,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -269,9 +269,6 @@ export class DialogEnergyGridFlowSettings
|
||||
[this._params!.direction === "from"
|
||||
? "stat_energy_from"
|
||||
: "stat_energy_to"]: ev.detail.value,
|
||||
[this._params!.direction === "from"
|
||||
? "entity_energy_from"
|
||||
: "entity_energy_to"]: ev.detail.value,
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user