Explorar el Código

[variable_value] wrong sign in get_value_since

Maxime Alves LIRMM@home hace 3 años
padre
commit
88d947ea9d
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2
    1
      pyheatpump/models/variable_value.py

+ 2
- 1
pyheatpump/models/variable_value.py Ver fichero

@@ -67,12 +67,13 @@ class VariableValue(RowClass):
67 67
     @staticmethod
68 68
     def get(var_type, address, time=datetime.now()):
69 69
         try:
70
+            print(int(time.strftime('%s'))+1)
70 71
             row = next(DB.sql(
71 72
             """SELECT * FROM var_value
72 73
             WHERE
73 74
                 type = :type
74 75
                 AND address = :address
75
-                AND time <= :time
76
+                AND time >= :time
76 77
             ORDER BY time DESC
77 78
             LIMIT 1""", {
78 79
                 'type':str(var_type), 'address':address, 'time':int(time.strftime('%s'))+1

Loading…
Cancelar
Guardar