Add preheating HVAC action to climate (#16922)

This commit is contained in:
Franck Nijhof 2023-06-19 13:36:19 +02:00 committed by GitHub
parent 40c8301df0
commit 8abb58ae7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 1 deletions

View File

@ -135,6 +135,9 @@ const ENTITIES: HassEntity[] = [
createEntity("climate.fan_only", "fan_only"), createEntity("climate.fan_only", "fan_only"),
createEntity("climate.auto_idle", "auto", undefined, { hvac_action: "idle" }), createEntity("climate.auto_idle", "auto", undefined, { hvac_action: "idle" }),
createEntity("climate.auto_off", "auto", undefined, { hvac_action: "off" }), createEntity("climate.auto_off", "auto", undefined, { hvac_action: "off" }),
createEntity("climate.auto_preheating", "auto", undefined, {
hvac_action: "preheating",
}),
createEntity("climate.auto_heating", "auto", undefined, { createEntity("climate.auto_heating", "auto", undefined, {
hvac_action: "heating", hvac_action: "heating",
}), }),

View File

@ -102,7 +102,15 @@ const FIXED_DOMAIN_ATTRIBUTE_STATES = {
frontend_stream_type: ["hls", "web_rtc"], frontend_stream_type: ["hls", "web_rtc"],
}, },
climate: { climate: {
hvac_action: ["off", "idle", "heating", "cooling", "drying", "fan"], hvac_action: [
"off",
"idle",
"preheating",
"heating",
"cooling",
"drying",
"fan",
],
}, },
cover: { cover: {
device_class: [ device_class: [

View File

@ -16,6 +16,7 @@ export const CLIMATE_PRESET_NONE = "none";
export type HvacAction = export type HvacAction =
| "off" | "off"
| "preheating"
| "heating" | "heating"
| "cooling" | "cooling"
| "drying" | "drying"
@ -77,6 +78,7 @@ export const HVAC_ACTION_TO_MODE: Record<HvacAction, HvacMode> = {
cooling: "cool", cooling: "cool",
drying: "dry", drying: "dry",
fan: "fan_only", fan: "fan_only",
preheating: "heat",
heating: "heat", heating: "heat",
idle: "off", idle: "off",
off: "off", off: "off",

View File

@ -2,6 +2,7 @@ import {
mdiClockOutline, mdiClockOutline,
mdiFan, mdiFan,
mdiFire, mdiFire,
mdiHeatWave,
mdiPower, mdiPower,
mdiSnowflake, mdiSnowflake,
mdiWaterPercent, mdiWaterPercent,
@ -21,6 +22,7 @@ export const CLIMATE_HVAC_ACTION_ICONS: Record<HvacAction, string> = {
heating: mdiFire, heating: mdiFire,
idle: mdiClockOutline, idle: mdiClockOutline,
off: mdiPower, off: mdiPower,
preheating: mdiHeatWave,
}; };
export const CLIMATE_HVAC_ACTION_MODE: Record<HvacAction, HvacMode> = { export const CLIMATE_HVAC_ACTION_MODE: Record<HvacAction, HvacMode> = {
@ -30,6 +32,7 @@ export const CLIMATE_HVAC_ACTION_MODE: Record<HvacAction, HvacMode> = {
heating: "heat", heating: "heat",
idle: "off", idle: "off",
off: "off", off: "off",
preheating: "heat",
}; };
export const computeClimateBadge: ComputeBadgeFunction = (stateObj) => { export const computeClimateBadge: ComputeBadgeFunction = (stateObj) => {