Add remove_authorized_client for local key un-pairing - #8
Merged
Conversation
Wires up AuthorizationMessages field 3/4 (remove_authorized_client request/response), which were previously commented out in the proto. Message shapes ported from Matthew1471/Tesla-API: the request carries a single `bytes public_key = 1` and the response is empty. PowerwallClient.remove_authorized_client accepts either raw DER bytes or the base64 string exactly as list_authorized_clients reports it, so a record round-trips straight out of that listing. Because the response message has no fields, some firmware may omit the oneof entirely, so the call tolerates a missing response and returns None; callers wanting positive confirmation should re-read the listing. PowerwallEnergySite.remove_authorized_client graduates from placeholder to a real mapping. The cloud EnergySite has no counterpart, so there was no signature to mirror -- the old `params: dict` placeholder shape was speculative and is replaced with public_key-first, matching add_authorized_client. Verified against a real PW3: removed three ECC test records, including one in AUTHORIZED_STATE_VERIFIED, leaving the five RSA records untouched. Notable asymmetry worth knowing: adding a key requires a physical presence proof, while removing one needs only an authenticated v1r session -- even for a VERIFIED record. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wires up AuthorizationMessages field 3/4 (remove_authorized_client request/response), which were previously commented out in the proto. Message shapes ported from Matthew1471/Tesla-API: the request carries a single
bytes public_key = 1and the response is empty.PowerwallClient.remove_authorized_client accepts either raw DER bytes or the base64 string exactly as list_authorized_clients reports it, so a record round-trips straight out of that listing. Because the response message has no fields, some firmware may omit the oneof entirely, so the call tolerates a missing response and returns None; callers wanting positive confirmation should re-read the listing.
PowerwallEnergySite.remove_authorized_client graduates from placeholder to a real mapping. The cloud EnergySite has no counterpart, so there was no signature to mirror -- the old
params: dictplaceholder shape was speculative and is replaced with public_key-first, matching add_authorized_client.Verified against a real PW3: removed three ECC test records, including one in AUTHORIZED_STATE_VERIFIED, leaving the five RSA records untouched. Notable asymmetry worth knowing: adding a key requires a physical presence proof, while removing one needs only an authenticated v1r session -- even for a VERIFIED record.