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

Unifying registry definitions for different inverter models #161

Closed
canton7 opened this issue Apr 18, 2023 · 2 comments
Closed

Unifying registry definitions for different inverter models #161

canton7 opened this issue Apr 18, 2023 · 2 comments
Labels
refactoring Refactoring

Comments

@canton7
Copy link
Collaborator

canton7 commented Apr 18, 2023

Hi,

I've been thinking about finishing off the H3 support, and shuddering at the thought of adding and maintaining another set of largely duplicate register definitions.

I think there might be some mileage in tagging the entity descriptions with the inverter models which provide that register. That way we just have a single list to maintain.

I haven't worked out a nice syntax yet... Maybe something like:

ModbusSensorDescription(
    key="pv1_voltage",
    address_specs=[
        AddressSpec(type=AUX, models=[H1, AC1, AIO_H1], addresses=[11000]),
        AddressSpec(type=LAN, models=[H1, AC1, AIO_H1], addresses=[31000]),
    ],
    ...
)

Or perhaps:

ModbusSensorDescription(
    key="pv1_voltage",
    address_specs=[
        AddressSpec(models=[H1, AC1, AIO_H1], lan=[11000], aux=[31000]),
    ],
    ...
)

Or maybe:

ModbusSensorDescription(
    key="pv1_voltage",
    address_specs=[
        AddressSpec(type=LAN, model=H1, variants=[BASE, AC1, AOI], addresses=[11000]),
        AddressSpec(type=AUX, model=H1, variants=[BASE, AC1, AOI], addresses=[31000]),
    ],
    ...
)

@nathanmarlor What do you think?

@canton7
Copy link
Collaborator Author

canton7 commented Apr 18, 2023

I think I'm currently favouring number 2...

@canton7
Copy link
Collaborator Author

canton7 commented Apr 24, 2023

Implemented in #167

@canton7 canton7 closed this as completed Apr 24, 2023
@canton7 canton7 added the refactoring Refactoring label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactoring
Projects
None yet
Development

No branches or pull requests

1 participant