Browse Source

[lib] use of a result variable in shift_response, add macAddress

Maxime Alves LIRMM@home 3 years ago
parent
commit
a256f0a3ff
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      pyheatpump/lib.py

+ 6
- 5
pyheatpump/lib.py View File

@@ -10,18 +10,19 @@ def shift_response(d):
10 10
         d_res = {
11 11
             str(k - offset): d_[k]
12 12
             for k in d_k
13
-            if (k in d_ and (isinstance(d_[k], int) or isinstance(d_[k], float)))
13
+            if (k in d_)
14 14
         }
15 15
 
16 16
         return d_res
17 17
 
18
+    d_shifted = { 'macAddress': d['macAddress'] }
18 19
     if 'Analog' in d.keys():
19
-        d.update({"Analog": shift_dict(d['Analog'])})
20
+        d_shifted['Analog'] = shift_dict(d['Analog'])
20 21
 
21 22
     if 'Integer' in d.keys():
22
-        d.update({"Integer": shift_dict(d['Integer'])})
23
+        d_shifted['Integer'] = shift_dict(d['Integer'])
23 24
 
24 25
     if 'Digital' in d.keys():
25
-        d.update({"Digital": shift_dict(d['Digital'])})
26
+        d_shifted['Digital'] = shift_dict(d['Digital'])
26 27
 
27
-    return d
28
+    return d_shifted

Loading…
Cancel
Save