Climate
climate
climate domain implementation.
SPEC
module-attribute
SPEC: DomainSpec[Climate] = register_domain(DomainSpec(name='climate', entity_cls=Climate))
The DomainSpec registered with the shared DomainRegistry.
Climate
Bases: Entity
A Home Assistant climate (thermostat / HVAC) entity.
The public API uses set_hvac_mode for all mode changes rather
than exposing raw turn_on / turn_off services.
Source code in src/haclient/domains/climate.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
current_temperature
property
current_temperature: float | None
Current measured temperature, if reported.
target_temperature
property
target_temperature: float | None
Current target temperature set-point.
hvac_mode
property
hvac_mode: str
Active HVAC mode (same as state).
hvac_modes
property
hvac_modes: list[str]
Supported HVAC modes reported by Home Assistant.
on_hvac_mode_change
on_hvac_mode_change(func: ValueChangeHandler) -> ValueChangeHandler
Register a listener for HVAC mode changes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
callable
|
Sync or async callable invoked with |
required |
Returns:
| Type | Description |
|---|---|
callable
|
The same func, returned for decorator use. |
Source code in src/haclient/domains/climate.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
on_temperature_change
on_temperature_change(func: ValueChangeHandler) -> ValueChangeHandler
Register a listener for current temperature changes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
callable
|
Callable invoked with |
required |
Returns:
| Type | Description |
|---|---|
callable
|
The same func, returned for decorator use. |
Source code in src/haclient/domains/climate.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
on_target_temperature_change
on_target_temperature_change(func: ValueChangeHandler) -> ValueChangeHandler
Register a listener for target temperature changes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
callable
|
Callable invoked with |
required |
Returns:
| Type | Description |
|---|---|
callable
|
The same func, returned for decorator use. |
Source code in src/haclient/domains/climate.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
set_temperature
async
set_temperature(temperature: float, *, hvac_mode: str | None = None, **extra: Any) -> None
Set the target temperature, optionally changing HVAC mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temperature
|
float
|
New target temperature, in the units configured on the entity. |
required |
hvac_mode
|
str or None
|
HVAC mode to switch to alongside the temperature change. |
None
|
**extra
|
Any
|
Additional fields forwarded verbatim to Home Assistant
(e.g. |
{}
|
Source code in src/haclient/domains/climate.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
set_hvac_mode
async
set_hvac_mode(hvac_mode: str) -> None
Change the HVAC mode (e.g. "heat", "cool", "off").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hvac_mode
|
str
|
One of the modes reported by |
required |
Source code in src/haclient/domains/climate.py
122 123 124 125 126 127 128 129 130 | |
set_fan_mode
async
set_fan_mode(fan_mode: str) -> None
Set the fan mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fan_mode
|
str
|
Fan mode supported by the device (e.g. |
required |
Source code in src/haclient/domains/climate.py
132 133 134 135 136 137 138 139 140 141 | |