Browse Source

[variable_value] wrong sign in get_value_since

Maxime Alves LIRMM@home 4 years ago
parent
commit
88d947ea9d
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      pyheatpump/models/variable_value.py

+ 2
- 1
pyheatpump/models/variable_value.py View File

@@ -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…
Cancel
Save