diff --git a/gallery/src/pages/misc/entity-state.ts b/gallery/src/pages/misc/entity-state.ts index ab395b71a111..8d38fe9413d6 100644 --- a/gallery/src/pages/misc/entity-state.ts +++ b/gallery/src/pages/misc/entity-state.ts @@ -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", }), diff --git a/src/common/entity/get_states.ts b/src/common/entity/get_states.ts index 24e9fa4a7eef..7307a06e2229 100644 --- a/src/common/entity/get_states.ts +++ b/src/common/entity/get_states.ts @@ -122,13 +122,14 @@ const FIXED_DOMAIN_ATTRIBUTE_STATES = { }, climate: { hvac_action: [ - "off", - "idle", - "preheating", - "heating", "cooling", + "defrosting", "drying", "fan", + "heating", + "idle", + "off", + "preheating", ], }, cover: { diff --git a/src/data/climate.ts b/src/data/climate.ts index 97a2557c71f7..30ee11d2b909 100644 --- a/src/data/climate.ts +++ b/src/data/climate.ts @@ -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 = { 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 = { diff --git a/src/fake_data/entity_component_icons.ts b/src/fake_data/entity_component_icons.ts index 90b580f977e7..242f301516a6 100644 --- a/src/fake_data/entity_component_icons.ts +++ b/src/fake_data/entity_component_icons.ts @@ -907,6 +907,7 @@ export const ENTITY_COMPONENT_ICONS: Record = { idle: "mdi:clock-outline", off: "mdi:power", preheating: "mdi:heat-wave", + defrosting: "mdi:snowflake-melt", }, }, preset_mode: {