Browse Source

[api] fix variable_valuesand variables (passes test)

Maxime Alves LIRMM@home 3 years ago
parent
commit
8caf9145df
2 changed files with 4 additions and 4 deletions
  1. 2
    2
      pyheatpump/variable_values.py
  2. 2
    2
      pyheatpump/variables.py

+ 2
- 2
pyheatpump/variable_values.py View File

@@ -26,7 +26,7 @@ async def set_variable_values(request):
26 26
 async def get_variable_value(var_type: str, address: int, time: str=None):
27 27
     try:
28 28
         args = {
29
-            'type': var_type,
29
+            'var_type': var_type,
30 30
             'address': address,
31 31
             'time': time
32 32
         }
@@ -37,7 +37,7 @@ async def get_variable_value(var_type: str, address: int, time: str=None):
37 37
 
38 38
         row = VariableValue.get(**args)
39 39
 
40
-        return PlainTextResponse(str(row.value))
40
+        return PlainTextResponse(str(row.get_value()))
41 41
     except StopIteration:
42 42
         raise HTTPException(404)
43 43
 

+ 2
- 2
pyheatpump/variables.py View File

@@ -20,7 +20,7 @@ async def get_variables(request):
20 20
     return JSONResponse({
21 21
         key: {
22 22
             add: wo_type(var.__dict__)
23
-                for add, var in var_type.items()
23
+            for add, var in var_type.items()
24 24
         } for key, var_type in Variable.getall().items()
25 25
     })
26 26
 
@@ -47,7 +47,7 @@ async def variables_routes(request, *args, **kwargs):
47 47
         return await get_variables(request)
48 48
     elif request['method'] == 'POST':
49 49
         return await set_variables(request)
50
-    raise NotImplementedError;
50
+    raise NotImplementedError
51 51
 
52 52
 
53 53
 ROUTES=[

Loading…
Cancel
Save