Replies: 5 comments 10 replies
-
First thing that comes to mind is how would you solve different yamls using different component versions/git tags/commit shas? |
Beta Was this translation helpful? Give feedback.
-
I like your route and think this should not be tied to just HACs. Could not HACs create a yaml file to "automate" this for the end user?
Let HACs create that file. Maybe even add this to the esphome dashboard. |
Beta Was this translation helpful? Give feedback.
-
My intention with packages was more to decouple components from the main ESPHome package (to allow for different release frequency) and allow for third party libraries to be easily integrated. Installation becomes a simple Was less about installing individual components although that would be a supported use-case. Before I got swamped with other work I was looking at the following:
However, both the package approach and defining external dependencies in your YAML file that are downloaded as required could go hand in hand. Both solutions cover slightly different use-cases. |
Beta Was this translation helpful? Give feedback.
-
Hey @glmnet and @jesserockz check this pull request which is a significant extension to existing packages functionality.
Quick usage example: packages:
base:
source: packages/heating_ctrl.pkg/base.yaml
params:
ssid: blahblah
log_level: INFO At the moment I implemented just local file system loader but there is an abstraction which will allows us to implement GitHub loader, maybe some generic http loader etc. So it could be like this: packages:
base:
source: github:corvis/esphome-packages/packages/jb_heating.pkg@66d019d
params:
ssid: blahblah
log_level: INFO This could be a good base for community registry and the way to exchange packages.
|
Beta Was this translation helpful? Give feedback.
-
I implemented a version of this here and would like some feedback on the syntax. For the system: I saw @timsavage's proposal for using PyPi/pip for this, which looks interesting. However, I think people having to publish to PyPi (and having to set up the setup.py file etc for packaging) is a problem. Also I heard that pkg_resources has a high overhead (at least it says so in the importlib docs). My PR implements it using the So the question for you guys is: What syntax for the YAML, and what repository setup for the custom component should we use? The PR implements it like this: external_components:
- source: esphome/esphome@importlib-custom-components
# Optional: specify which components to import, otherwise all
components: [bh1750] That says: import the The repo setup should then be like this: for example:
This way, if the custom component needs multiple esphome components, those can easily be added. So, is this setup good/would another one be better for custom component creators? Is there a better name for the |
Beta Was this translation helpful? Give feedback.
-
The general idea is to simplify how people uses third party ESPHome components in their installations.
@jesserockz pointed me today about adding ESPHome into HACs, if I understand right, the idea will be that community made components can be retrieved from HACs, and HACs will take care of copying the repository files into the custom_components folder, this has the advantage of many people using more components easily. Here is his conversation with Ludeus https://github.com/hacs/integration/discussions/1935
There is also already an approach here #957 by @timsavage this one relies on PyPI to retrieve the components, and install them on the system, like normal python packages, this requires a modification on ESPHome to find components on the python package system.
--
The problem I see with HACs is that you need HACs!! That is, if you use esphome from command line, or without HomaAssistant "full" (i.e. only core) then this will not help you much.
The problem with packages, I see a bit complex on the user having to figure out how to get the package from git, where to download, where to run the command and let alone have him setup a virtualenv.
Both of these also suffer the problem that the yaml now compiles on a previously setup environment.
I have another idea a few month ago, what about adding this functionality to esphome itself?
components could be retrieved by a special component, e.g.
This component will just download the stuff and keep the
custom_components
folder updated with components needed. There might be a few issues to resolve on the way but seems quite straightforward to use and share stuffBeta Was this translation helpful? Give feedback.
All reactions