-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
Add Sunsynk Integration #85893
base: dev
Are you sure you want to change the base?
Add Sunsynk Integration #85893
Conversation
Hi jamesridgway It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is my feedback to try to get the process started for you!
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Several comments from @Lash-L still outstanding. |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
6ea80a4
to
f8f5bae
Compare
Also, feel free to close review comments if you think you solved them :) |
I also discussed this PR with some other members, and we kinda have the guideline, if it's connecting to a local device, 1 IP = 1 config entry. If it's connecting to a cloud service, 1 account = 1 config entry. If people really don't want a certain inverter in there, you can always disable it |
No problem, I've updated this to respect this. |
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = { | ||
CONF_NAME: username, | ||
SUNSYNK_COORDINATOR: coordinator, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = { | |
CONF_NAME: username, | |
SUNSYNK_COORDINATOR: coordinator, | |
} | |
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = coordinator |
We already have the username from entry.data so not sure why we should attach it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if CONF_USERNAME not in data or CONF_PASSWORD not in data: | ||
raise InvalidAuth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be needed as you control the data that it gets from the schema and also given as little as this validation is you might just put it in the step code instead directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
) | ||
|
||
|
||
class SunsynkHub: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is also constructed from the scaffold script and doesn't seem necessary as you can also put it directly in the step
super().__init__( | ||
hass, | ||
_LOGGER, | ||
# Name of the data. For logging purposes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Name of the data. For logging purposes. |
Remove unnecessary commenting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In many places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
data[inverter.sn] = inverter_data | ||
return data | ||
except InvalidCredentialsException as err: | ||
raise ConfigEntryAuthFailed(err) from err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs an reauth step in the config flow
SUNSYNK_COORDINATOR | ||
] | ||
|
||
inverters = await coordinator.api.get_inverters() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should already have it in coordinator.data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This comment was marked as outdated.
This comment was marked as outdated.
Working on latest feedback comments |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Working on latest feedback comments |
Breaking change
Proposed change
Add Integration for Sunsynk inverters.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: