Browse Source

[cli] suppression du sleep

Maxime Alves LIRMM@home 3 years ago
parent
commit
078e1cf534
2 changed files with 5 additions and 2 deletions
  1. 0
    1
      pyheatpump/cli.py
  2. 5
    1
      pyheatpump/models/variable_type.py

+ 0
- 1
pyheatpump/cli.py View File

@@ -228,7 +228,6 @@ def supervise(since):
228 228
             verify=False,
229 229
             timeout=200
230 230
         )
231
-        time.sleep(5)
232 231
         if post_resp.status_code == 200:
233 232
             logger.info('POST to supervisor succeeded')
234 233
             continue

+ 5
- 1
pyheatpump/models/variable_type.py View File

@@ -24,7 +24,8 @@ class VariableType(RowClass):
24 24
     def cast(self):
25 25
         # Function to convert numbers > 2**15 to negative numbers (issue #30)
26 26
         #complement = lambda x: x - (1 << 16 if x & (1 << 15) else 0)
27
-        complement = lambda x: x - (1 << 16) if x >> 15 else x
27
+        #complement = lambda x: x - (1 << 16) if x >> 15 else x
28
+        complement = lambda x: int.from_bytes(bytes(x), 'big', signed=True)
28 29
 
29 30
         if self.type == 'bool':
30 31
             # returns a boolean
@@ -107,8 +108,11 @@ class VariableType(RowClass):
107 108
             # Value is stored as integers in database
108 109
             value = int(f_value)
109 110
 
111
+
112
+            """
110 113
             if address not in range(self.start_address, self.end_address + 1):
111 114
                 continue
115
+            """
112 116
 
113 117
             if not Variable(**{
114 118
                     'type': self,

Loading…
Cancel
Save