Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Add manifest.json to custom_component #1

Open
Adminiuga opened this issue Jun 10, 2020 · 8 comments
Open

Add manifest.json to custom_component #1

Adminiuga opened this issue Jun 10, 2020 · 8 comments

Comments

@Adminiuga
Copy link
Member

We could try manifest.json to custom component and have a dependency in form of

{
  "requirements": ["git+https://github.com/zigpy/zigpy-znp.git@rolling-release#zigpy-znp==0.1.0"]
}

Which would keep updating the module from the git on HA restarts, unless zigpy-znp==0.1.0 is installed. This would allow for a quicker update distribution for users willing to test it, just by pushing the updates into rolling-release branch (all branch names are examples only)

See https://developers.home-assistant.io/docs/creating_integration_manifest#custom-requirements-during-development--testing for more details

@puddly
Copy link
Contributor

puddly commented Jun 10, 2020

That's a good idea. Does this require moving the custom component into a module folder?

@Adminiuga
Copy link
Member Author

Not quite sure I'm following. Maybe we should split the custom_component into it's own repo, but I think we could keep it in here for now and just re-organize ./custom_components/zha_custom_radios.py into ./custom_components/zha_custom_radios/zha_custom_radios.py and add here the __init__.py and manifest.json

If you mean that, then yeah, the custom component should become a module, but not the zigpy_znp module.

If we split into it's own repo, then we could add it to HACS for easier installation.

@puddly
Copy link
Contributor

puddly commented Jun 10, 2020

Yeah, that's fine.

No part of the custom component hard-codes zigpy-znp so it might be useful as an external module, in case someone wants to write another library for a new radio (I guess NXP and Nordic are the only ones left?) and test it with HA.

@Adminiuga
Copy link
Member Author

That's a good idea!
With a minor problem of finding a volunteer to write NXP lib 😃

@Adminiuga
Copy link
Member Author

Sent you the invite, should have enough permission to create a new repo if you decide so

@puddly
Copy link
Contributor

puddly commented Jun 10, 2020

Thanks. I'll probably give it a try in a couple of days.

@puddly puddly transferred this issue from zigpy/zigpy-znp Jun 13, 2020
@puddly
Copy link
Contributor

puddly commented Jul 12, 2020

There's no way to make this custom component work, I'm afraid. The manifest.json does get HA to auto-install dependencies but its presence also makes this component load way after zha to do its thing. The only way (as far as I can tell) to actually run code early is to purposefully create a legacy custom component and abuse the fact that it's imported before being loaded: https://github.com/zha-ng/zigpy-znp/blob/dev/custom_components/zha_custom_radios.py

At that point it'd be easier to have the component install zigpy-znp itself, though that's getting a little too complex for my liking.

@Adminiuga
Copy link
Member Author

Ah, yep. I don't know any other way to make it user friendly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants