-
-
Notifications
You must be signed in to change notification settings - Fork 995
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into area-square-meters-docs
- Loading branch information
Showing
93 changed files
with
3,914 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
author: Joost Lekkerkerker | ||
authorURL: https://github.com/joostlek | ||
authorImageURL: https://avatars.githubusercontent.com/u/7083755?v=4 | ||
title: "Integration quality scale" | ||
--- | ||
|
||
Since the original quality scale was introduced in 2020, Home Assistant changed quite a lot. | ||
Both in how integrations are developed and what features they can provide. | ||
The quality scale, however, has not been updated to reflect these changes. | ||
|
||
For the last couple of months, we have been working with the community on a new integration quality scale that fits the current state of Home Assistant. | ||
To give an overview of the changes: | ||
|
||
- The quality scale now has four scaled tiers: Bronze, Silver, Gold, and Platinum. The newly added Bronze tier is the new minimum requirement for new core integrations going forward. This does lower the bar for new integrations for a bit, but it does make it clear upfront what is expected from a core integration in this day and age. | ||
- A new non-scaled tier, legacy, has been added for integrations that are not configurable via the UI yet. This tier would indicate to the user that the integration might not meet their expectation compared to integrations configurable via the UI. | ||
- To allow the scale to grow with Home Assistant and to avoid another major rework in the future, we have designed a rulebook for the scale so it's known what needs to happen when a rule is added. | ||
- To show that the project has a commitment on keeping the scale up to date, we have created an architecture decision record (ADR) that describes the goal and the process of keeping the scale up to date. | ||
- The developer documentation now has [a brand new section](/docs/core/integration-quality-scale/) dedicated to the Integration Quality Scale. It includes the rules and the reasoning for every rule, and it provides examples that can be used to give an idea of how to implement it. There is also [a checklist](/docs/core/integration-quality-scale/checklist) that can be used for changing the scale of an integration. | ||
- Documentation now also plays a role in the quality of the integrations, since the user experience of an integration goes beyond code. | ||
- To track the progress of integration, we have added [a `quality_scale.yaml` file](https://github.com/home-assistant/core/blob/dev/homeassistant/components/airgradient/quality_scale.yaml) to the integration folder. This will contain a list of all the rules the integration is adhering to and notes of possible exemptions and the reasons behind them. | ||
|
||
With this in place, you might wonder what the next steps are. | ||
Because this is a major rework of the scale, we have decided to drop the scale of the current integrations. | ||
This means that those integrations have to create a PR to get their scale back to the level they think it should be. | ||
|
||
I would also like to motivate the community to help out with getting as many integrations to Bronze (or above) as possible. | ||
I also want to thank the community for their input in the quality scale and their effort in maintaining the integrations. | ||
Home Assistant would not be where it is today without the community ❤️. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
author: Abílio Costa | ||
authorURL: https://github.com/abmantis | ||
title: "Translating units of measurement" | ||
--- | ||
|
||
Home Assistant 2024.12 will support the translation of custom units of measurement. Previously, those would have been hardcoded in their integrations. | ||
|
||
Just like for entity names, integrations just need to set the `translation_key` on the entity definition and provide the unit designation in the `strings.json` file (with the new `unit_of_measurement` key): | ||
|
||
```json | ||
{ | ||
"entity": { | ||
"sensor": { | ||
"subscribers_count": { | ||
"unit_of_measurement": "subscribers" | ||
}, | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Check our [backend localization documentation](/docs/internationalization/core#unit-of-measurement-of-entities) for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
author: Robert Resch | ||
authorURL: https://github.com/edenhaus | ||
authorImageURL: https://avatars.githubusercontent.com/u/26537646?s=96&v=4 | ||
title: "Camera API changes" | ||
--- | ||
|
||
With Home Assistant `2024.11` we added WebRTC for most cameras. To add support for it we needed to refactor and improve the camera entity. | ||
Today we would like to announce that with the upcoming Home Assistant release `2024.12` the following methods are deprecated and will be removed with Home Assistant version `2025.6`: | ||
|
||
- The property `frontend_stream_type` will be removed. As of `2024.11` Home assistant will identify the frontend stream type by checking if the camera entity implements the native WebRTC methods ([#130932](https://github.com/home-assistant/core/pull/130932)). Card developers can use the new websocket command `camera/capabilities` to get the frontend stream types. | ||
|
||
- The method `async_handle_web_rtc_offer` will be removed. Please use `async_handle_async_webrtc_offer` and the async WebRTC signaling approach ([#131285](https://github.com/home-assistant/core/pull/131285)). | ||
|
||
- The method `async_register_rtsp_to_web_rtc_provider` has been deprecated. Please use `async_register_webrtc_provider`, which offers more flexibility and supports the async WebRTC signaling approach ([#131462](https://github.com/home-assistant/core/pull/131462)). | ||
|
||
More information about the replacements can be found in the [camera entity documentation](/docs/core/entity/camera). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
author: Erik Montnemery | ||
authorURL: https://github.com/emontnemery | ||
title: "Utility function homeassistant.util.dt.utc_to_timestamp is deprecated" | ||
--- | ||
|
||
The utility function `homeassistant.util.dt.utc_to_timestamp` is deprecated and will be removed in Home Assistant Core 2026.1, custom integrations which call it should instead call the stdlib method `datetime.datetime.timestamp()` | ||
|
||
The reason for deprecation is that the stdlib method is just as fast as the utility function. | ||
|
||
More details can be found in the [core PR](https://github.com/home-assistant/core/pull/131787). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
author: G Johansson | ||
authorURL: https://github.com/gjohansson-ST | ||
authorImageURL: https://avatars.githubusercontent.com/u/62932417?v=4 | ||
authorTwitter: GJohansson | ||
title: "Climate entity now supports independent horizontal swing" | ||
--- | ||
|
||
As of Home Assistant Core 2024.12, we have implemented an independent property and method for controlling horizontal swing in `ClimateEntity`. | ||
|
||
Integrations that support completely independent control and state for vertical and horizontal swing can now use the previous `swing_mode` for vertical swing only and use the new `swing_horizontal_mode` for providing the horizontal swing state and control. | ||
|
||
Integrations that don't have independent control should still keep using the current `swing_mode` for both vertical and horizontal support. | ||
|
||
|
||
### Example | ||
|
||
Example requirements to implement `swing` and `swing_horizontal` in your climate entity. | ||
|
||
```python | ||
|
||
class MyClimateEntity(ClimateEntity): | ||
"""Implementation of my climate entity.""" | ||
|
||
@property | ||
def supported_features(self) -> ClimateEntityFeature: | ||
"""Return the list of supported features.""" | ||
return ClimateEntityFeature.SWING_MODE | ClimateEntityFeature.SWING_HORIZONTAL_MODE | ||
|
||
@property | ||
def swing_mode(self) -> str | None: | ||
"""Return the swing setting. | ||
Requires ClimateEntityFeature.SWING_MODE. | ||
""" | ||
return self._attr_swing_mode | ||
|
||
@property | ||
def swing_modes(self) -> list[str] | None: | ||
"""Return the list of available swing modes. | ||
Requires ClimateEntityFeature.SWING_MODE. | ||
""" | ||
return self._attr_swing_modes | ||
|
||
@property | ||
def swing_horizontal_mode(self) -> str | None: | ||
"""Return the swing setting. | ||
Requires ClimateEntityFeature.SWING_HORIZONTAL_MODE. | ||
""" | ||
return self._attr_swing_horizontal_mode | ||
|
||
@property | ||
def swing_horizontal_modes(self) -> list[str] | None: | ||
"""Return the list of available swing modes. | ||
Requires ClimateEntityFeature.SWING_HORIZONTAL_MODE. | ||
""" | ||
return self._attr_swing_horizontal_modes | ||
|
||
async def async_set_swing_mode(self, swing_mode: str) -> None: | ||
"""Set new target swing operation.""" | ||
await self.api.set_swing_mode(swing_mode) | ||
|
||
async def async_set_swing_horizontal_mode(self, swing_horizontal_mode: str) -> None: | ||
"""Set new target horizontal swing operation.""" | ||
await self.api.set_swing_horizontal_mode(swing_horizontal_mode) | ||
|
||
``` | ||
|
||
More details can be found in the [climate documentation](/docs/core/entity/climate#swing-modes). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
author: G Johansson | ||
authorURL: https://github.com/gjohansson-ST | ||
authorImageURL: https://avatars.githubusercontent.com/u/62932417?v=4 | ||
authorTwitter: GJohansson | ||
title: "New vacuum state property" | ||
--- | ||
|
||
As of Home Assistant Core 2025.1, the constants used to return state in `StateVacuumEntity` are deprecated and replaced by the `VacuumActivity` enum. | ||
|
||
Also with this change, integrations should set the `activity` property instead of directly setting the `state` property. | ||
|
||
There is a one-year deprecation period, and the constants will stop working from 2026.1 to ensure all custom integration authors have time to adjust. | ||
|
||
### Example | ||
|
||
```python | ||
|
||
from homeassistant.components.vacuum import VacuumActivity | ||
|
||
class MyVacuumCleaner(StateVacuumEntity): | ||
"""My vacuum cleaner.""" | ||
|
||
@property | ||
def activity(self) -> VacuumActivity | None: | ||
"""Return the state of the vacuum.""" | ||
if self.device.is_cleaning(): | ||
return VacuumActivity.CLEANING | ||
return VacuumActivity.DOCKED | ||
|
||
``` | ||
|
||
More details can be found in the [vacuum documentation](/docs/core/entity/vacuum#states). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
author: L Boué | ||
authorURL: https://github.com/lboue | ||
authorTwitter: lboue | ||
title: "Changed name of WaterHeaterEntityDescription" | ||
--- | ||
|
||
A naming error of the entity description was found in the Water Heater integration, and we have now renamed `WaterHeaterEntityEntityDescription` to `WaterHeaterEntityDescription` in the 2025.1 release. | ||
The old `WaterHeaterEntityEntityDescription` is deprecated, due for removal in 2026.1, and developpers are advised to use the new `WaterHeaterEntityDescription` instead. | ||
|
||
See details in the core PR: [#132888](https://github.com/home-assistant/core/pull/132888). |
105 changes: 105 additions & 0 deletions
105
blog/2024-12-14-kelvin-preferred-color-temperature-unit.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
author: epenet | ||
authorURL: https://github.com/epenet | ||
title: "Use Kelvin as the preferred color temperature unit" | ||
--- | ||
|
||
### Summary of changes | ||
|
||
In October 2022, Home Assistant migrated the preferred color temperature unit from mired to kelvin. | ||
|
||
It is now time to add deprecation warnings for the corresponding attributes, constants and properties: | ||
* Deprecate state and capability attributes `ATTR_COLOR_TEMP`, `ATTR_MIN_MIREDS` and `ATTR_MAX_MIREDS` | ||
* Deprecate constants `ATTR_KELVIN` and `ATTR_COLOR_TEMP` from the `light.turn_on` service call | ||
* Deprecate properties `LightEntity.color_temp`, `LightEntity.min_mireds` and `LightEntity.max_mireds` | ||
* Deprecate corresponding attributes `LightEntity._attr_color_temp`, `LightEntity._attr_min_mired` and `LightEntity._attr_max_mired` | ||
|
||
### Examples | ||
|
||
#### Custom minimum/maximum color temperature | ||
|
||
```python | ||
class MyLight(LightEntity): | ||
"""Representation of a light.""" | ||
|
||
# Old | ||
# _attr_min_mireds = 200 # 5000K | ||
# _attr_max_mireds = 400 # 2500K | ||
|
||
# New | ||
_attr_min_color_temp_kelvin = 2500 # 400 mireds | ||
_attr_max_color_temp_kelvin = 5000 # 200 mireds | ||
``` | ||
|
||
#### Default minimum/maximum color temperature | ||
|
||
```python | ||
from homeassistant.components.light import DEFAULT_MAX_KELVIN, DEFAULT_MIN_KELVIN | ||
|
||
class MyLight(LightEntity): | ||
"""Representation of a light.""" | ||
|
||
# Old did not need to have _attr_min_mireds / _attr_max_mireds set | ||
# New needs to set the default explicitly | ||
_attr_min_color_temp_kelvin = DEFAULT_MIN_KELVIN | ||
_attr_max_color_temp_kelvin = DEFAULT_MAX_KELVIN | ||
``` | ||
|
||
#### Dynamic minimum/maximum color temperature | ||
|
||
```python | ||
from homeassistant.util import color as color_util | ||
|
||
class MyLight(LightEntity): | ||
"""Representation of a light.""" | ||
|
||
# Old | ||
# def min_mireds(self) -> int: | ||
# """Return the coldest color_temp that this light supports.""" | ||
# return device.coldest_temperature | ||
# | ||
# def max_mireds(self) -> int: | ||
# """Return the warmest color_temp that this light supports.""" | ||
# return device.warmest_temperature | ||
|
||
# New | ||
def min_color_temp_kelvin(self) -> int: | ||
"""Return the warmest color_temp that this light supports.""" | ||
return color_util.color_temperature_mired_to_kelvin(device.warmest_temperature) | ||
|
||
def max_color_temp_kelvin(self) -> int: | ||
"""Return the coldest color_temp that this light supports.""" | ||
return color_util.color_temperature_mired_to_kelvin(device.coldest_temperature) | ||
``` | ||
|
||
#### Service call | ||
|
||
```python | ||
from homeassistant.components.light import ATTR_COLOR_TEMP_KELVIN | ||
from homeassistant.util import color as color_util | ||
|
||
class MyLight(LightEntity): | ||
"""Representation of a light.""" | ||
def turn_on(self, **kwargs: Any) -> None: | ||
"""Turn on the light.""" | ||
# Old | ||
# if ATTR_COLOR_TEMP in kwargs: | ||
# color_temp_mired = kwargs[ATTR_COLOR_TEMP] | ||
# color_temp_kelvin = color_util.color_temperature_mired_to_kelvin(color_temp_mired) | ||
|
||
# Old | ||
# if ATTR_KELVIN in kwargs: | ||
# color_temp_kelvin = kwargs[ATTR_KELVIN] | ||
# color_temp_mired = color_util.color_temperature_kelvin_to_mired(color_temp_kelvin) | ||
|
||
# New | ||
if ATTR_COLOR_TEMP_KELVIN in kwargs: | ||
color_temp_kelvin = kwargs[ATTR_COLOR_TEMP_KELVIN] | ||
color_temp_mired = color_util.color_temperature_kelvin_to_mired(color_temp_kelvin) | ||
``` | ||
|
||
### Background information | ||
|
||
* [Community discussion about Kelvin temperature](https://community.home-assistant.io/t/wth-is-light-temperature-not-in-kelvin/467449/6) | ||
* [Core PR #79591: Migration to Kelvin](https://github.com/home-assistant/core/pull/79591) | ||
* [Architecture discussion #564](https://github.com/home-assistant/architecture/discussions/564) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
author: Joost Lekkerkerker | ||
authorURL: https://github.com/joostlek | ||
authorImageURL: https://avatars.githubusercontent.com/u/7083755?v=4 | ||
title: "Moving to Pydantic v2" | ||
--- | ||
|
||
Pydantic is a widely used library in Python for data validation. On June 30, 2023, Pydantic v2 was released, introducing significant changes that are not backward compatible with Pydantic v1. | ||
|
||
Starting with Home Assistant Core 2025.1, Pydantic v2 will replace v1. If your custom integration uses Pydantic, it must be updated to support Pydantic v2 to keep working in the upcoming release. | ||
|
||
Over the past year, our community has worked hard to ensure that the libraries used by Home Assistant Core are compatible with both Pydantic v1 and v2. This dual compatibility has helped make our transition to Pydantic v2 as smooth as possible. | ||
|
||
For a quick migration, you can use the Pydantic v1 shims included in Pydantic v2. Detailed information about using these shims in a v1/v2 environment can be found in the [Pydantic migration guide](https://docs.pydantic.dev/latest/migration/#using-pydantic-v1-features-in-a-v1v2-environment). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.