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

Powerlimiter calc method /set method refactor #164

Conversation

MalteSchm
Copy link

@MalteSchm MalteSchm commented Apr 7, 2023

I started to work on the PowerLimiter code a bit. Creating a PR with the following changes:

calcPowerLimit

  • refactored to reduce the nesting level of if/else statements. This makes the code easier to read in my mind and I hope you agree
  • Make sure that the check for old values respects the DTU poll interval. I assumed that the old value 15 was meant to be 3x 5 seconds (with 5s being the default DTU value)

setNewPowerLimit

  • refactored to reduce the nesting level of if/else statements. This makes the code easier to read in my mind and I hope you agree
  • This could be a bug: Subsequent calls to this method with the same power limit would not re-trigger starting / stopping the inverter. Depending on the requested power limit this case will be triggered in cases where the user turns the inverter off / on manually.

Webapp lint fails for same reason as development branch. Tested on my setup

@MalteSchm MalteSchm changed the title Powerlimiter calc set method refactor Powerlimiter calc method /set method refactor Apr 7, 2023
@MalteSchm
Copy link
Author

MalteSchm commented Apr 11, 2023

any feedback on this change?
I have the fix for the webapp linting error ready but this is on a branch that contains the refactoring of these two functions. A PR will have these included so I did not submit this yet

Copy link

github-actions bot commented Apr 7, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant