Bladeren bron

[variable_value] wrong sign in get_value_since

Maxime Alves LIRMM@home 3 jaren geleden
bovenliggende
commit
88d947ea9d
1 gewijzigde bestanden met toevoegingen van 2 en 1 verwijderingen
  1. 2
    1
      pyheatpump/models/variable_value.py

+ 2
- 1
pyheatpump/models/variable_value.py Bestand weergeven

@@ -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…
Annuleren
Opslaan