-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ports existing functionality to v4 API (#3)
Closes #2
- Loading branch information
1 parent
260a94f
commit e52d62d
Showing
8 changed files
with
443 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
{ | ||
"info": { | ||
"_postman_id": "274a5c9b-df54-48b1-a24e-25405890f016", | ||
"name": "Enpahse Enlighten v4", | ||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Fetch systems", | ||
"request": { | ||
"auth": { | ||
"type": "bearer", | ||
"bearer": [ | ||
{ | ||
"key": "token", | ||
"value": "{{access_token}}", | ||
"type": "string" | ||
} | ||
] | ||
}, | ||
"method": "GET", | ||
"header": [ | ||
{ | ||
"key": "Host", | ||
"value": "api.enphaseenergy.com", | ||
"type": "text" | ||
} | ||
], | ||
"url": { | ||
"raw": "https://api.enphaseenergy.com/api/v4/systems?key={{app_api_key}}", | ||
"protocol": "https", | ||
"host": [ | ||
"api", | ||
"enphaseenergy", | ||
"com" | ||
], | ||
"path": [ | ||
"api", | ||
"v4", | ||
"systems" | ||
], | ||
"query": [ | ||
{ | ||
"key": "key", | ||
"value": "{{app_api_key}}" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Generate OAuth2 access_token", | ||
"request": { | ||
"auth": { | ||
"type": "basic", | ||
"basic": [ | ||
{ | ||
"key": "password", | ||
"value": "{{client_secret}}", | ||
"type": "string" | ||
}, | ||
{ | ||
"key": "username", | ||
"value": "{{client_id}}", | ||
"type": "string" | ||
} | ||
] | ||
}, | ||
"method": "POST", | ||
"header": [], | ||
"url": { | ||
"raw": "https://api.enphaseenergy.com/oauth/token?grant_type=authorization_code&redirect_uri=https://api.enphaseenergy.com/oauth/redirect_uri&code={{auth_code}}", | ||
"protocol": "https", | ||
"host": [ | ||
"api", | ||
"enphaseenergy", | ||
"com" | ||
], | ||
"path": [ | ||
"oauth", | ||
"token" | ||
], | ||
"query": [ | ||
{ | ||
"key": "grant_type", | ||
"value": "authorization_code" | ||
}, | ||
{ | ||
"key": "redirect_uri", | ||
"value": "https://api.enphaseenergy.com/oauth/redirect_uri" | ||
}, | ||
{ | ||
"key": "code", | ||
"value": "{{auth_code}}" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Refresh access_token", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"exec": [ | ||
"" | ||
], | ||
"type": "text/javascript" | ||
} | ||
} | ||
], | ||
"request": { | ||
"auth": { | ||
"type": "basic", | ||
"basic": [ | ||
{ | ||
"key": "password", | ||
"value": "{{client_secret}}", | ||
"type": "string" | ||
}, | ||
{ | ||
"key": "username", | ||
"value": "{{client_id}}", | ||
"type": "string" | ||
} | ||
] | ||
}, | ||
"method": "POST", | ||
"header": [], | ||
"url": { | ||
"raw": "https://api.enphaseenergy.com/oauth/token?grant_type=refresh_token&refresh_token={{refresh_token}}", | ||
"protocol": "https", | ||
"host": [ | ||
"api", | ||
"enphaseenergy", | ||
"com" | ||
], | ||
"path": [ | ||
"oauth", | ||
"token" | ||
], | ||
"query": [ | ||
{ | ||
"key": "grant_type", | ||
"value": "refresh_token" | ||
}, | ||
{ | ||
"key": "refresh_token", | ||
"value": "{{refresh_token}}" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "inverters_summary_by_envoy_or_site", | ||
"request": { | ||
"auth": { | ||
"type": "bearer", | ||
"bearer": [ | ||
{ | ||
"key": "token", | ||
"value": "{{access_token}}", | ||
"type": "string" | ||
} | ||
] | ||
}, | ||
"method": "GET", | ||
"header": [ | ||
{ | ||
"key": "Host", | ||
"value": "api.enphaseenergy.com", | ||
"type": "text" | ||
} | ||
], | ||
"url": { | ||
"raw": "https://api.enphaseenergy.com/api/v4/systems/inverters_summary_by_envoy_or_site?key={{app_api_key}}&site_id={{system_id}}", | ||
"protocol": "https", | ||
"host": [ | ||
"api", | ||
"enphaseenergy", | ||
"com" | ||
], | ||
"path": [ | ||
"api", | ||
"v4", | ||
"systems", | ||
"inverters_summary_by_envoy_or_site" | ||
], | ||
"query": [ | ||
{ | ||
"key": "key", | ||
"value": "{{app_api_key}}" | ||
}, | ||
{ | ||
"key": "site_id", | ||
"value": "{{system_id}}" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "<some name>", | ||
"system_id": "<system/site_id", | ||
"api_url": "https://api.enphaseenergy.com/", | ||
"app_api_key": "<your app's api_key>", | ||
"app_client_id": "<your app's client ID>", | ||
"app_client_secret": "<your app's client secret>", | ||
"access_token": "<your access_token from running 'Enpahse Enlighten v4.postman_collection' -> 'Generate OAuth2 access_token'>", | ||
"refresh_token": "<your refresh_token from running 'Enpahse Enlighten v4.postman_collection' -> 'Generate OAuth2 access_token'>", | ||
"spreadsheet_id": "<google sheet_id>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
requests==2.24.0 | ||
google-api-python-client==1.12.3 | ||
google-auth-httplib2==0.0.4 | ||
google-auth-oauthlib==0.4.1 |
Oops, something went wrong.