From f65f3fef948a3d786bcdd489b35dea037e013d89 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Sun, 7 Jul 2024 18:54:51 +0200 Subject: [PATCH] Add defrosting to climate entity (#2240) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Franck Nijhof --- ...024-07-07-climate-hvacaction-defrosting.md | 27 +++++++++++++++++++ docs/core/entity/climate.md | 1 + 2 files changed, 28 insertions(+) create mode 100644 blog/2024-07-07-climate-hvacaction-defrosting.md diff --git a/blog/2024-07-07-climate-hvacaction-defrosting.md b/blog/2024-07-07-climate-hvacaction-defrosting.md new file mode 100644 index 00000000..24283357 --- /dev/null +++ b/blog/2024-07-07-climate-hvacaction-defrosting.md @@ -0,0 +1,27 @@ +--- +author: G Johansson +authorURL: https://github.com/gjohansson-ST +title: "New HVACAction DEFROSTING" +--- + +The `ClimateEntity` has an `hvac_action` property, which describes what the climate entity is currently doing (which is not the same as its mode). + +We have added `DEFROSTING` as a possible `HVACAction` to represent when an entity is currently defrosting. + +Defrosting is when the system runs in reverse for some time to melt down accumulated ice. It occurs typically in colder environments and should not be mixed with, for example, cars that are defrosting by heating their windows. + +```python +from homeassistant.components.climate.const import HVACAction + +class MyClimateEntity(ClimateEntity): + """Implementation of my climate entity.""" + + def hvac_action(self) -> HVACAction | None: + """Return the current running hvac operation if supported.""" + return HVACAction.DEFROSTING + +``` + +More details can be found in the [climate entity documentation](/docs/core/entity/climate#hvac-action) + +Background for the original change is in [architecture discussion #1090](https://github.com/home-assistant/architecture/discussions/1090). diff --git a/docs/core/entity/climate.md b/docs/core/entity/climate.md index b4354523..5c802abf 100644 --- a/docs/core/entity/climate.md +++ b/docs/core/entity/climate.md @@ -65,6 +65,7 @@ The HVAC action describes the _current_ action. This is different from the mode, | `HVACAction.DRYING` | Device is drying. | | `HVACAction.FAN` | Device has fan on. | | `HVACAction.IDLE` | Device is idle. | +| `HVACAction.DEFROSTING` | Device is defrosting. | ### Presets