Browse Source

[variable_type] reset HEAD~1 models/variable_type.py

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

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

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

Loading…
Cancel
Save