mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-13 04:16:29 +00:00
Add new single_config_entry
manifest option (#2074)
* Add new `single_instance_only` manifest option * Add dev blog about manifest option * change version * Rename * Apply code review suggestions
This commit is contained in:
parent
a3fd00696a
commit
7921fa1787
14
blog/2024-02-26-single-instance-only-manifest-option.md
Normal file
14
blog/2024-02-26-single-instance-only-manifest-option.md
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
author: Jan-Philipp Benecke
|
||||
authorURL: https://github.com/jpbede
|
||||
authorImageURL: https://avatars.githubusercontent.com/u/3989428?s=96&v=4
|
||||
title: "New single instance only manifest option"
|
||||
---
|
||||
|
||||
In Home Assistant 2024.3, we introduced a new `single_config_entry` option for the integration manifest file.
|
||||
This option allows you to set that your integration supports only one config entry.
|
||||
|
||||
Home Assistant will take care and prevent the initialization of a config flow if there is already a config entry for the integration.
|
||||
This way you won't have to implement any check in the config flow.
|
||||
|
||||
Integrations that have this option not set in their manifest and do the check in the config flow should replace it with the new option.
|
@ -116,6 +116,16 @@ Specify the `config_flow` key if your integration has a config flow to create a
|
||||
}
|
||||
```
|
||||
|
||||
### Single config entry only
|
||||
|
||||
Specify the `single_config_entry` key if your integration supports only one config entry. When specified, it will not allow the user to add more than one config entry for this integration.
|
||||
|
||||
```json
|
||||
{
|
||||
"single_config_entry": true
|
||||
}
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
Requirements are Python libraries or modules that you would normally install using `pip` for your component. Home Assistant will try to install the requirements into the `deps` subdirectory of the Home Assistant [configuration directory](https://www.home-assistant.io/docs/configuration/) if you are not using a `venv` or in something like `path/to/venv/lib/python3.6/site-packages` if you are running in a virtual environment. This will make sure that all requirements are present at startup. If steps fail, like missing packages for the compilation of a module or other install errors, the component will fail to load.
|
||||
|
Loading…
x
Reference in New Issue
Block a user