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.auto_idle", "auto", undefined, { hvac_action: "idle" }),
createEntity("climate.auto_off", "auto", undefined, { hvac_action: "off" }),
createEntity("climate.auto_preheating", "auto", undefined, {
hvac_action: "preheating",
}),
createEntity("climate.auto_heating", "auto", undefined, {
hvac_action: "heating",
}),

View File

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

View File

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

View File

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