Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/energy_local_control.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ async def make_local_energysite(session: aiohttp.ClientSession) -> PowerwallEner
return PowerwallEnergySite(powerwall_client)
```

An early Tesla Backup Gateway 1 (Powerwall 2) rejects the last-5-characters
login `PowerwallClient` sends and needs the full gateway password. Build its
A Tesla Backup Gateway 1 (Powerwall 2) rejects the last-5-characters login
`PowerwallClient` sends and needs the customer (Legacy) password set in the
Tesla One app, sent unchanged. Build its
client with `PowerwallClient.legacy_gateway(...)`, which takes the same
arguments. `is_legacy_gateway(site_info)` tells you which one a site needs: pass
it the body of the cloud `site_info()` response (`response`), and it returns
Expand Down
9 changes: 5 additions & 4 deletions tesla_fleet_api/tesla/powerwall/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,11 @@ def legacy_gateway(
session: aiohttp.ClientSession | None = None,
timeout: float = 5.0,
) -> PowerwallClient:
"""Create a client for an early Gateway 1 (Powerwall 2) unit.
"""Create a client for a Backup Gateway 1 (Powerwall 2) unit.

These units reject the last-5-characters login that the default
constructor sends, and need the full ``gateway_password`` instead.
constructor sends. Pass the customer (Legacy) password set in the
Tesla One app as ``gateway_password``; it is sent unchanged.
Comment on lines +230 to +234

@gitar-bot gitar-bot Bot Nov 26, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: transport.py comment still describes the old 'early Gateway 1' wording

This PR updates the legacy_gateway and is_legacy_gateway docstrings and the docs. They now say every Backup Gateway 1 refuses the last-5 login and takes the customer (Legacy) password from the Tesla One app, sent unchanged. The comment in V1rTransport.__init__ (transport.py), on the line that picks password if legacy_gateway else _customer_password(password), was not updated. It still says "Early Gateway 1 (Powerwall 2) units reject the truncated password and need the full value." That contradicts the new docs and could lead a maintainer to treat the untruncated value as the full gateway/WiFi password again. Update that comment to match.

Align the transport comment with the corrected wording:

# Backup Gateway 1 (Powerwall 2) units reject the last-5-characters
# login; they take the customer (Legacy) password set in the Tesla
# One app, sent unchanged.
self._password = password if legacy_gateway else _customer_password(password)

Was this helpful? React with 👍 / 👎

Everything else is the same as the default constructor. Use
:func:`is_legacy_gateway` on the site's cloud ``site_info`` to tell
which constructor a site needs.
Expand Down Expand Up @@ -1773,8 +1774,8 @@ def is_legacy_gateway(site_info: Any) -> bool:
read from ``components.gateways[].part_number``, or from the site ``id``
(the gateway DIN, which starts with the part number) when no listed
gateway has a part number. A True result means the site needs
:meth:`PowerwallClient.legacy_gateway`, which logs in with the full
gateway password. Raises :class:`InvalidResponse` when ``site_info`` is
:meth:`PowerwallClient.legacy_gateway`, which sends the password
unchanged. Raises :class:`InvalidResponse` when ``site_info`` is
not a mapping or carries neither a gateway part number nor an ``id``.
"""
if not isinstance(site_info, Mapping):
Expand Down
Loading