1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-02-15 07:25:54 +00:00

Add defrosting to HVAC actions for ClimateEntity (#21330)

This commit is contained in:
G Johansson
2024-07-07 18:54:58 +02:00
committed by GitHub
parent aa49d6ef6b
commit 877d0db1bb
4 changed files with 12 additions and 5 deletions

View File

@@ -140,6 +140,9 @@ const ENTITIES: HassEntity[] = [
createEntity("climate.auto_preheating", "auto", undefined, {
hvac_action: "preheating",
}),
createEntity("climate.auto_defrosting", "auto", undefined, {
hvac_action: "defrosting",
}),
createEntity("climate.auto_heating", "auto", undefined, {
hvac_action: "heating",
}),

View File

@@ -125,6 +125,7 @@ const FIXED_DOMAIN_ATTRIBUTE_STATES = {
"off",
"idle",
"preheating",
"defrosting",
"heating",
"cooling",
"drying",

View File

@@ -28,13 +28,14 @@ export type HvacMode = (typeof HVAC_MODES)[number];
export const CLIMATE_PRESET_NONE = "none";
export type HvacAction =
| "off"
| "preheating"
| "heating"
| "cooling"
| "defrosting"
| "drying"
| "fan"
| "heating"
| "idle"
| "fan";
| "off"
| "preheating";
export type ClimateEntity = HassEntityBase & {
attributes: HassEntityAttributeBase & {
@@ -89,12 +90,13 @@ export const compareClimateHvacModes = (mode1: HvacMode, mode2: HvacMode) =>
export const CLIMATE_HVAC_ACTION_TO_MODE: Record<HvacAction, HvacMode> = {
cooling: "cool",
defrosting: "heat",
drying: "dry",
fan: "fan_only",
preheating: "heat",
heating: "heat",
idle: "off",
off: "off",
preheating: "heat",
};
export const CLIMATE_HVAC_MODE_ICONS: Record<HvacMode, string> = {

View File

@@ -907,6 +907,7 @@ export const ENTITY_COMPONENT_ICONS: Record<string, ComponentIcons> = {
idle: "mdi:clock-outline",
off: "mdi:power",
preheating: "mdi:heat-wave",
defrosting: "mdi:snowflake-melt",
},
},
preset_mode: {