anotherjulien / MyHOME

MyHOME integration for Home-Assistant
GNU Affero General Public License v3.0
135 stars 54 forks source link

Development environment setup #34

Open mcanaleta opened 2 years ago

mcanaleta commented 2 years ago

Hi! I'm working on a pull request to support the BTI 3456 IR emitters for air conditioning units in advanced mode (M=0). I got them working at the OWNd level. Now I'm working on the integration, and I'm not sure what is the right way to setup the development environment (it's my first contribution to home assitant). What I did is to fork the home assistant core repo, and copy the integration into /components but this way I lose the git repository. I'm using vscode.

So how does your dev environment look like?

Thanks and congrats on the integration!

anotherjulien commented 2 years ago

I'm afraid I have not found a perfect setup :-/ I have a workspace that is only a copy of the Git repo, and when I wish to test changes, I copy the files over to a docker container running a test Home-Assistant instance. It's cumbersome, but it mostly works.

If you do find a better workflow, I be glad to know about it!

stepir commented 2 years ago

https://www.gitpod.io ?

mcanaleta commented 2 years ago

I have no experience with gitpod.io, but it looks like it solves a different problem - launching a dev environment in the cloud?

I've set up a small solution that works for me, which is basically installing hass core in the python environment, and using a small dev.py script that launches hass using the homeassistant.runner module (learned from hass main.py). With this:

Apart from that, I use Pipenv to manage the virtualenv and dependencies.

Check my branch https://github.com/mcanaleta/MyHOME/tree/dev-environment. Documentation is in the CONTRIBUTING.md file (https://github.com/mcanaleta/MyHOME/blob/dev-environment/CONTRIBUTING.md).

If having a dev.py in the root is a problem for hacs or something, it can be moved to some folder like /scripts or so.

Let me know how it works for you guys.

Cheers!