Skip to content

Add remove_authorized_client for local key un-pairing - #8

Merged
Bre77 merged 1 commit into
mainfrom
remove-authorized-client
Aug 2, 2026
Merged

Add remove_authorized_client for local key un-pairing#8
Bre77 merged 1 commit into
mainfrom
remove-authorized-client

Conversation

@Bre77

@Bre77 Bre77 commented Aug 2, 2026

Copy link
Copy Markdown
Member

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.

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>
@Bre77
Bre77 merged commit e8391ce into main Aug 2, 2026
8 checks passed
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.

1 participant