SE-57: new script for UPS Tower battery status#520
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 205a8a9128
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| D.failure(D.errorType.AUTHENTICATION_ERROR); | ||
| return; | ||
| } | ||
| D.success(); |
There was a problem hiding this comment.
Validate controller credentials before succeeding association
The validate() RPC claims to verify that the API key and controller IP are correct, but it only checks that the parameters are non-empty and then always returns D.success(). This means a mistyped IP or invalid API key will pass association and only fail later during collection, which makes misconfigurations harder to detect and troubleshoot at onboarding time.
Useful? React with 👍 / 👎.
| var externalDevice = D.createExternalDevice(udmIp); | ||
| var options = { | ||
| protocol: "https", | ||
| url: "/proxy/network/api/s/default/stat/device", |
There was a problem hiding this comment.
Avoid hardcoding UniFi site to default
The request path is fixed to /proxy/network/api/s/default/stat/device, so controllers where the UPS belongs to any non-default site will never return that device and the driver will fail with RESOURCE_UNAVAILABLE despite valid credentials and connectivity. This should be site-aware (parameterized or discovered) to work across standard multi-site UniFi deployments.
Useful? React with 👍 / 👎.
No description provided.