Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype layout for repo #102

Open
rand12345 opened this issue Mar 6, 2023 · 2 comments
Open

Prototype layout for repo #102

rand12345 opened this issue Mar 6, 2023 · 2 comments

Comments

@rand12345
Copy link
Contributor

I noticed that you are integrating H3 inverters into the repo. Having seen this form of integration before with other platforms I'm offering a suggestion for a new layout which should help the maintainer's sanity when propagating changes. This isn't a PR although you are welcome to take it.

Pros:

  • User IP configuration is outside the repo, all held in /secrets.yaml
  • Selecting a communications method is set in /configuration.yaml and users to not edit repo files
  • Better maintainability, common modbus entries are shared between communication methods. One change propagates through inheritance
  • Feature updates require no selective copy and pasting which nips yaml issues in the bud
  • One copy and paste entry is needed to add this config to /configuration.yaml (see edited readme.md)
  • Can be symlinked to /config/custom_componants/HA-FoxESS-Modbus permitting git pulls within the home directory

Cons:

  • Breaking change occurs through instantiation, needs configuration.yaml updating and two entries in /secrets.yaml

https://github.com/rand12345/HA-FoxESS-Modbus/tree/new-layout-prototype

@Ndrinta
Copy link
Contributor

Ndrinta commented Mar 8, 2023

Up for you.
I remember finding extremely confusing to have to use the "USB" version to then edit it to change it use he USR even thought that's on LAN so why wouldn't I use the "LAN" one? After reading the documentation then started to make sense but I never accepted the naming convention... I thought, wouldn't be better to have the "USB" version renamed to "RS485" and then you choose between USB or LAN?
I initially believe would be better to have a 3 versions: a pure LAN one and 2 flavours of RS485 (RS485 -USB and RS485-LAN). Agreed, this would still be a little confusing but at least you can just copy and paste the code from git without making changes at every update but then I saw this and I believe your solution is far better.

@williamjeccles
Copy link
Collaborator

I'm discussing with Chris about adding this as a user setting so you can simply install this integration via Hacs, during the install we ask you to select your inverter model and connection method, provide an IP address and bingo it's now working and future updates can be auto-applied.

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

No branches or pull requests

3 participants