Development with

Hi, I’m new here. I set up Home Assistant with on my raspberry pi because the docs led me down that road and it seemed sensible. I later learned that uses some kind of packaging system, which makes it difficult to modify, but I don’t really want to start over. I’ve worked around this to do some small modifications by hacking through with my own python custom_component and extra_html_url for some frontend stuff.

Is there a way to make and test code changes with, in a way that can also be usefully presented to the community? (I’m also completely new to github.)

Anyone have any knowledge that could help me here? Even just “yup, don’t use if you want to write code” would be sort of useful.

Hi can you clarify by what you mean by ‘modify’? Develop new components?

More like, submitting bugfixes or new features to existing components. I guess developing new components is possible because I could make them as custom_components, right? I’ve been messing around with the frontend a bit (particularly the color picker) and the zha component to improve its interaction with my lights. Some of my changes are things that are probably only useful to me, but some might be useful for giving back to the community.

Specifically, I’m modifying the zha component by creating a custom_component that imports zha and then overrides zha.Light with my own object (which inherits from zha.Light) via assignment. This is obviously a crazy hack and not the way I “should” be modifying it - if nothing else, it makes it more difficult to give the code to anyone else who might benefit from it. Also, the further I go down this road, the more I risk breaking compatibility with future versions. I’d prefer to be writing code by downloading the original source and modifying it directly, then perhaps submitting changes that others would benefit from. But as far as I can tell, prevents me from making changes like that and actually running them.

So, is there a better way?

You definitely want to read the developer docs thoroughly, and get familiar with the activity on Github.
Also get on discord and checkout the dev chat channel :slight_smile:

I’m kind of struggling with the same issue as TS.
I want to write some improvements to home-assistant and
But I see no easy way to test and deploy the changes.

The workflow I would be aiming for:

  • clone hassio and/or home-assistant and make a new feature/modification branch
  • write some changes
  • code review and commit changes.
  • test locally for run/build/syntax errors
  • push to running installation (with the necessary hardware to test)
  • if all good, then make a pull request

There must be an easy/workable workflow right?
Without building new images for testing every little commit.

1 Like

Hi Novapax, I’ve asked the same questions on discord and some folks confirmed that is possible to test it manually overriding a component. It only applies if you are developing a new component or a bug fix for it.

I also have this question and I did not see where the OP got an answer.
I have done component testing in the custom_components directory.
I would like to look at something in the helpers directory, specific
Is there a way using my instance of hassio?