Do not send Pause/Resume to API if we know it will be rejected#187
Conversation
The "Resume/Stop charging" buttons are disabled/grayed out when they cannot be used. I tried doing the same for the "Charging"-switch, but it appears it just ignores the availability setting and triggers anyway. The is_command_valid check in the command-function will still block the API call if we are in a state where the command is not legal, and raising the exception triggers a popup in the UI for direct user feedback.
|
Related to #175 |
sveinse
left a comment
There was a problem hiding this comment.
On a second review, I think this is good. Please consider the nit-picks below. I'm ready to merge when you're happy.
|
Ready for merge from my side @sveinse |
|
@steinmn you can chose: Do you want this merged before or after we merge the PR for the circuits? I'm ready to merge now, and I don't think it should interfere with the other PR, but I leave it for you to chose. |
|
One thought that occurred to me (only slightly off topic): The current master has little to no changes from the user-perspective, but reduces the load on the zaptec API by skipping the settings-call for every charger. Should we consider releasing that as a 0.7.5-version? |
|
That reminds me that I forgot to mention the CHANGELOG.md update. Oh well, have to do it when the release is made. There are some important fixes in the PR queue, such as the reduction of bursting which should be commited before making a release. |
|
Ok, I suggest we merge this then, and I can include the changelog entry in the changes I'm working on for the circuits-PR. |
|
@steinmn Thank you very much for your contributions 👍 |
The "Resume/Stop charging" buttons are disabled/grayed out when they cannot be used.
I tried doing the same for the "Charging"-switch, but it appears it just ignores the availability setting and triggers anyway. The is_command_valid check in the command-function will still block the API call if we are in a state where the command is not legal, and raising the exception triggers a popup in the UI for direct user feedback.