summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/home/api/web_api_client.py4
-rwxr-xr-xsrc/web_api.py3
2 files changed, 3 insertions, 4 deletions
diff --git a/src/home/api/web_api_client.py b/src/home/api/web_api_client.py
index aac81a0..f359b11 100644
--- a/src/home/api/web_api_client.py
+++ b/src/home/api/web_api_client.py
@@ -107,13 +107,13 @@ class WebAPIClient:
return files
def inverter_get_consumed_energy(self, s_from: str, s_to: str):
- return self._post('inverter/consumed_energy/', {
+ return self._get('inverter/consumed_energy/', {
'from': s_from,
'to': s_to
})
def inverter_get_grid_consumed_energy(self, s_from: str, s_to: str):
- return self._post('inverter/grid_consumed_energy/', {
+ return self._get('inverter/grid_consumed_energy/', {
'from': s_from,
'to': s_to
})
diff --git a/src/web_api.py b/src/web_api.py
index fc6eb49..8c039e0 100755
--- a/src/web_api.py
+++ b/src/web_api.py
@@ -211,7 +211,6 @@ class WebAPIServer(http.HTTPServer):
dt_to = strptime_auto(s_to)
return dt_from, dt_to
-
async def GET_consumed_energy(self, req: http.Request):
dt_from, dt_to = self._get_inverter_from_to(req)
wh = InverterDatabase().get_consumed_energy(dt_from, dt_to)
@@ -219,7 +218,7 @@ class WebAPIServer(http.HTTPServer):
async def GET_grid_consumed_energy(self, req: http.Request):
dt_from, dt_to = self._get_inverter_from_to(req)
- wh = InverterDatabase().get_consumed_energy(dt_from, dt_to)
+ wh = InverterDatabase().get_grid_consumed_energy(dt_from, dt_to)
return self.ok(wh)