Document cloud account binding (§17): deviceBindV2 + token signature
This commit is contained in:
1 parent
b79adc5d54
commit
3c7e74fd0e
1 file changed
+28
@@ -396,6 +396,34 @@ Library: `power.get_power()` tries detail → load → EMS in order
|
||||
(`franklinwh_agate_client/power.py`); `LocalDeviceClient` gained
|
||||
`query_detail_info()` / `query_load_status()`.
|
||||
|
||||
## 17. Cloud account binding (installer flow)
|
||||
|
||||
Binding a unit to an account is an *installer commissioning* action, not
|
||||
a local-socket one (`sections/installer/bind_device/`):
|
||||
|
||||
- `BindDeviceProvider.bind()` POSTs a data map to
|
||||
**`RemoteInterface.deviceBind` → `POST {cloud}/manage/deviceBindV2`**,
|
||||
with `protocolVer: "V1.10.01"`, the installer `jobCode`, the
|
||||
`commissionId` (preset-site path via `InstallContext`), and the
|
||||
`BindDeviceEntity` payload. Result parses as
|
||||
`HttpResultEntity<BindDeviceEntity>` (bound `account`, distributor /
|
||||
financier ids/names).
|
||||
- Mirror calls: `queryDeviceBindData` →
|
||||
`GET {cloud}/manage/getGatewayBindData` (pre-check: is this gateway
|
||||
already bound, to whom) and `deviceUnbind` →
|
||||
`POST {cloud}/manage/unBindDevice` ("Are you sure you want to
|
||||
unbind?", `unbindSuccess` strings).
|
||||
- Request auth on cloud calls is a signature, not a session cookie:
|
||||
`RemoteService` computes **`MD5(jsonEncode(body) + "B6F3Zu&aW8XlH9CA")`**
|
||||
and sends it as the **`token`** header (dio `Options`). User login
|
||||
itself is Okta (`sunrun.okta.com`, MFA endpoints); the known cloud
|
||||
bases are `https://e-api.franklinwh.com/api/appapi` and
|
||||
`https://energy.franklinwh.com/*` (exact `/manage` base mapping lives
|
||||
in the `RemoteService` dio init).
|
||||
- Locally, bound devices land in the trusted-devices table
|
||||
(`DatabaseManager.getTrustedDevicesTableList`, consulted by
|
||||
`_checkConnectedNotTrustedAp` on direct-connect).
|
||||
|
||||
## 9. Bluetooth (BLE) transport — `communication_center/bluetooth`
|
||||
|
||||
- `BluetoothManager` (singleton), `BluetoothStatus`: `closed / connected / connecting / interrupted`.
|
||||
|
||||
Reference in new issue
Block a user