Browse Source

[variable_type] clean

Maxime Alves LIRMM@home 3 years ago
parent
commit
28ce9e05be
1 changed files with 1 additions and 3 deletions
  1. 1
    3
      pyheatpump/models/variable_type.py

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

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
 
110
-            if address not in range(self.start_address, self.end_address + 1):
111
-                continue
112
-
113
             if not Variable(**{
111
             if not Variable(**{
114
                     'type': self,
112
                     'type': self,
115
                     'address': address}).exists():
113
                     'address': address}).exists():

Loading…
Cancel
Save