Browse Source

[heatpump] add default value for last_update

Maxime Alves LIRMM@home 3 years ago
parent
commit
472937a09f
2 changed files with 3 additions and 3 deletions
  1. 2
    2
      pyheatpump/cli.py
  2. 1
    1
      pyheatpump/models/heatpump.py

+ 2
- 2
pyheatpump/cli.py View File

@@ -227,7 +227,7 @@ def supervise(since):
227 227
 
228 228
     get_path = '/'.join((
229 229
         config.get('supervisor', 'get_path'),
230
-        Heatpump(mac_address, 0).macformat
230
+        Heatpump(mac_address).macformat
231 231
     ))
232 232
     get_url = {
233 233
         **base_url,
@@ -240,7 +240,7 @@ def supervise(since):
240 240
     )
241 241
 
242 242
     control_data = get_resp.json()
243
-    if Heatpump(mac_addres, 0).control(control_data):
243
+    if Heatpump(mac_addres).control(control_data):
244 244
         logger.info('GET to supervisor succeded : updated values')
245 245
         set_last_update(int(datetime.now().strftime('%s')))
246 246
     else:

+ 1
- 1
pyheatpump/models/heatpump.py View File

@@ -14,7 +14,7 @@ class Heatpump:
14 14
     var_types: Dict
15 15
     last_update: int = None
16 16
 
17
-    def __init__(self, mac_address, last_update, types=[]):
17
+    def __init__(self, mac_address, last_update=0, types=[]):
18 18
         self.mac_address = mac_address
19 19
         self.last_update = last_update
20 20
         if len(types):

Loading…
Cancel
Save