Skip to content

Do not send Pause/Resume to API if we know it will be rejected#187

Merged
sveinse merged 2 commits intocustom-components:masterfrom
steinmn:only-send-resume-pause-in-legal-states
Jul 14, 2025
Merged

Do not send Pause/Resume to API if we know it will be rejected#187
sveinse merged 2 commits intocustom-components:masterfrom
steinmn:only-send-resume-pause-in-legal-states

Conversation

@steinmn
Copy link
Contributor

@steinmn steinmn commented Jul 2, 2025

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.

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.
@steinmn steinmn requested a review from sveinse July 6, 2025 17:07
@sveinse sveinse added this to the v0.8 milestone Jul 11, 2025
@sveinse
Copy link
Collaborator

sveinse commented Jul 11, 2025

Related to #175

Copy link
Collaborator

@sveinse sveinse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a second review, I think this is good. Please consider the nit-picks below. I'm ready to merge when you're happy.

@steinmn
Copy link
Contributor Author

steinmn commented Jul 14, 2025

Ready for merge from my side @sveinse

@sveinse
Copy link
Collaborator

sveinse commented Jul 14, 2025

@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.

@steinmn
Copy link
Contributor Author

steinmn commented Jul 14, 2025

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?

@sveinse
Copy link
Collaborator

sveinse commented Jul 14, 2025

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.

@steinmn
Copy link
Contributor Author

steinmn commented Jul 14, 2025

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.

@sveinse sveinse merged commit 180e05d into custom-components:master Jul 14, 2025
1 check passed
@sveinse
Copy link
Collaborator

sveinse commented Jul 14, 2025

@steinmn Thank you very much for your contributions 👍

@steinmn steinmn deleted the only-send-resume-pause-in-legal-states branch July 22, 2025 11:54
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

Successfully merging this pull request may close these issues.

2 participants