Repository navigation
Add is_legacy_gateway to detect a Backup Gateway 1 from site_info - #235
Conversation
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsAdding public gateway detection from site_info could misclassify gateway models, leading callers to select a login method that fails. Adds ✅ 1 closed✅ Edge Case: Gateway entries without a string part_number silently return False
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Approved For more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
Adds
is_legacy_gateway(site_info)totesla_fleet_api.tesla.powerwall, which says whether a site's gateway is an early Tesla Backup Gateway 1 that needsPowerwallClient.legacy_gateway(the full gateway password login) instead of the default last-5-characters login. It takes the body of the cloudsite_info()response and matches the Gateway 1 part number1118431-againstcomponents.gateways[].part_number, or against the siteid(the gateway DIN) when no listed gateway has a part number; a body that is not a mapping or has neither raisesInvalidResponse. This is the detection home-assistant/core#194397 does inside the Teslemetry integration; once this is released, a later Home Assistant change can switch that PR's detection to this helper.