Document file: scheme for external component via git (#3906)

This commit is contained in:
Clyde Stubbs 2024-06-06 05:27:09 +10:00 committed by GitHub
parent 783c3f3898
commit 9f6c87c463
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,6 +33,14 @@ You can find some basic documentation on creating your own components at :ref:`c
type: local type: local
path: my_components path: my_components
# use a component from a local git repository
- source:
type: git
url: file:///Users/user/path_to_repo
ref: my_awesome_branch
components: [my_awesome_component]
Configuration variables: Configuration variables:
- **source**: The location of the components you want to retrieve. See :ref:`external-components_local` - **source**: The location of the components you want to retrieve. See :ref:`external-components_local`
@ -42,7 +50,7 @@ Configuration variables:
git options: git options:
- **url** (**Required**, url): HTTP git repository url. See :ref:`external-components_git`. - **url** (**Required**, url): Git repository url. See :ref:`external-components_git`.
- **ref** (*Optional*, string): Git ref (branch or tag). If not specified the default branch is used. - **ref** (*Optional*, string): Git ref (branch or tag). If not specified the default branch is used.
- **username** (*Optional*, string): Username for the Git server, if one is required - **username** (*Optional*, string): Username for the Git server, if one is required
- **password** (*Optional*, string): Password for the Git server, if one is required - **password** (*Optional*, string): Password for the Git server, if one is required
@ -114,6 +122,8 @@ Retrieving components from git is the easiest way to use components not included
The source components should be inside a ``components`` folder or inside an ``esphome/components`` The source components should be inside a ``components`` folder or inside an ``esphome/components``
folder. The latter makes sharing a component from a forked ESPHome repository easier. folder. The latter makes sharing a component from a forked ESPHome repository easier.
The url to the repository may be remote (``http:`` or ``https:`` scheme) or local (``file:`` scheme with an absolute path.)
Example of git repositories Example of git repositories
*************************** ***************************
@ -165,6 +175,10 @@ HTTP git repositories in general are supported with this configuration:
type: git type: git
url: http://repository_url/ url: http://repository_url/
ref: branch_or_tag ref: branch_or_tag
source:
type: git
url: file:///Users/user/path_to_repo
ref: branch_or_tag
The source field accepts a short hand **github://** resource: The source field accepts a short hand **github://** resource: