Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nengyuanzhang committed Jul 16, 2024
2 parents ce81237 + 625e689 commit 492803d
Show file tree
Hide file tree
Showing 10 changed files with 1,410 additions and 508 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- added clone action to energy storage container in myems-api
- added export action to energy storage container in myems-api
- added actions for protocol in myems-api
- added space associated microgrids actions in myems-api
- added microgrid energy report
### Changed
- updated tariff price to keep 5 decimal places in database and myems-admin
### Fixed
Expand Down
129 changes: 121 additions & 8 deletions myems-api/MyEMS.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"info": {
"_postman_id": "6a96e345-3fed-4f92-9803-4004acf2e069",
"_postman_id": "9ef531c4-5029-4923-bc10-57b21c0835fb",
"name": "MyEMS",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "32357384"
"_exporter_id": "10906958"
},
"item": [
{
Expand Down Expand Up @@ -9576,7 +9576,7 @@
},
{
"key": "Token",
"value": "7a4bcdb432699959d71ce39b3eced148e9af6f2106ad2921585b84e9e4385b7e0078125c0f980159989f43016dc127d5ed28b389c84cc53a8891660819c3693c",
"value": "0b5457b93012e59380ff23d844113bbc68b82a6418dd634b769eb1c6c3f08b18f417bf8f6be4400f427af670eeec18cb99bc26480e132be313d7b844c8664f6a",
"description": "Login first to get a valid token"
},
{
Expand Down Expand Up @@ -9645,7 +9645,7 @@
},
{
"key": "Token",
"value": "7a4bcdb432699959d71ce39b3eced148e9af6f2106ad2921585b84e9e4385b7e0078125c0f980159989f43016dc127d5ed28b389c84cc53a8891660819c3693c",
"value": "0b5457b93012e59380ff23d844113bbc68b82a6418dd634b769eb1c6c3f08b18f417bf8f6be4400f427af670eeec18cb99bc26480e132be313d7b844c8664f6a",
"description": "Login first to get a valid token"
},
{
Expand Down Expand Up @@ -15964,7 +15964,7 @@
"response": []
},
{
"name": "Bind an Energe Storage Power Station to a Space",
"name": "Bind an Energy Storage Power Station to a Space",
"request": {
"method": "POST",
"header": [
Expand All @@ -15987,7 +15987,7 @@
],
"body": {
"mode": "raw",
"raw": "{\"data\":{\"equipment_id\":1}}"
"raw": "{\"data\":{\"energy_storage_power_station_id\":1}}"
},
"url": {
"raw": "{{base_url}}/spaces/1/energystoragepowerstations",
Expand All @@ -16004,7 +16004,7 @@
"response": []
},
{
"name": "DELETE an Energy Storage Power Station from Space",
"name": "Unbind an Energy Storage Power Station from Space",
"request": {
"method": "DELETE",
"header": [
Expand Down Expand Up @@ -16117,7 +16117,7 @@
"response": []
},
{
"name": "DELETE an Equipment from Space",
"name": "Unbind an Equipment from Space",
"request": {
"method": "DELETE",
"header": [
Expand Down Expand Up @@ -16266,6 +16266,119 @@
},
"response": []
},
{
"name": "GET All Microgrids of a Space",
"request": {
"method": "GET",
"header": [
{
"key": "User-UUID",
"value": "dcdb67d1-6116-4987-916f-6fc6cf2bc0e4",
"description": "Any admin users' UUID"
},
{
"key": "Token",
"value": "0b5457b93012e59380ff23d844113bbc68b82a6418dd634b769eb1c6c3f08b18f417bf8f6be4400f427af670eeec18cb99bc26480e132be313d7b844c8664f6a",
"description": "Login first to get a valid token"
},
{
"key": "API-Key",
"value": "c5ee62be2792ed4a59de1096511934288f4c192363529dafc00b3b35f81f224a5cc44c9aae46ac8966dc52f1ea0039395551bdf3f86aff6bb2b6b032834fc139",
"description": "Create API Key at myems-admin",
"disabled": true
}
],
"url": {
"raw": "{{base_url}}/spaces/1/microgrids",
"host": [
"{{base_url}}"
],
"path": [
"spaces",
"1",
"microgrids"
]
}
},
"response": []
},
{
"name": "Bind a Microgrid to a Space",
"request": {
"method": "POST",
"header": [
{
"key": "User-UUID",
"value": "dcdb67d1-6116-4987-916f-6fc6cf2bc0e4",
"description": "Any admin users' UUID"
},
{
"key": "Token",
"value": "0b5457b93012e59380ff23d844113bbc68b82a6418dd634b769eb1c6c3f08b18f417bf8f6be4400f427af670eeec18cb99bc26480e132be313d7b844c8664f6a",
"description": "Login first to get a valid token"
},
{
"key": "API-Key",
"value": "c5ee62be2792ed4a59de1096511934288f4c192363529dafc00b3b35f81f224a5cc44c9aae46ac8966dc52f1ea0039395551bdf3f86aff6bb2b6b032834fc139",
"description": "Create API Key at myems-admin",
"disabled": true
}
],
"body": {
"mode": "raw",
"raw": "{\"data\":{\"microgrid_id\":1}}"
},
"url": {
"raw": "{{base_url}}/spaces/1/microgrids",
"host": [
"{{base_url}}"
],
"path": [
"spaces",
"1",
"microgrids"
]
}
},
"response": []
},
{
"name": "Unbind a Microgrid from Space",
"request": {
"method": "DELETE",
"header": [
{
"key": "User-UUID",
"value": "dcdb67d1-6116-4987-916f-6fc6cf2bc0e4",
"description": "Any admin users' UUID"
},
{
"key": "Token",
"value": "0b5457b93012e59380ff23d844113bbc68b82a6418dd634b769eb1c6c3f08b18f417bf8f6be4400f427af670eeec18cb99bc26480e132be313d7b844c8664f6a",
"description": "Login first to get a valid token"
},
{
"key": "API-Key",
"value": "c5ee62be2792ed4a59de1096511934288f4c192363529dafc00b3b35f81f224a5cc44c9aae46ac8966dc52f1ea0039395551bdf3f86aff6bb2b6b032834fc139",
"description": "Create API Key at myems-admin",
"disabled": true
}
],
"url": {
"raw": "{{base_url}}/spaces/1/microgrids/1",
"host": [
"{{base_url}}"
],
"path": [
"spaces",
"1",
"microgrids",
"1"
]
}
},
"response": []
},
{
"name": "GET All OfflineMeters of a Space",
"request": {
Expand Down
10 changes: 7 additions & 3 deletions myems-api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
from reports import microgriddashboard
from reports import microgriddetails
from reports import microgridlist
from reports import microgridreporting
from reports import microgridreportingenergy
from reports import microgridsenergy
from reports import microgridsbilling
from reports import microgridscarbon
Expand Down Expand Up @@ -668,6 +668,10 @@
space.SpaceMeterCollection())
api.add_route('/spaces/{id_}/meters/{mid}',
space.SpaceMeterItem())
api.add_route('/spaces/{id_}/microgrids',
space.SpaceMicrogridCollection())
api.add_route('/spaces/{id_}/microgrids/{mid}',
space.SpaceMicrogridItem())
api.add_route('/spaces/{id_}/export',
space.SpaceExport())
api.add_route('/spaces/import',
Expand Down Expand Up @@ -1052,8 +1056,8 @@
microgriddetails.Reporting())
api.add_route('/reports/microgridlist',
microgridlist.Reporting())
api.add_route('/reports/microgridreporting',
microgridreporting.Reporting())
api.add_route('/reports/microgridreportingenergy',
microgridreportingenergy.Reporting())
api.add_route('/reports/microgridsenergy',
microgridsenergy.Reporting())
api.add_route('/reports/microgridsbilling',
Expand Down
Loading

0 comments on commit 492803d

Please sign in to comment.