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
             verify=False,
228
             verify=False,
229
             timeout=200
229
             timeout=200
230
         )
230
         )
231
-        time.sleep(5)
232
         if post_resp.status_code == 200:
231
         if post_resp.status_code == 200:
233
             logger.info('POST to supervisor succeeded')
232
             logger.info('POST to supervisor succeeded')
234
             continue
233
             continue

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

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

Loading…
Cancel
Save