Browse Source

[cli][supervise] check the real mac address

Maxime Alves LIRMM@home 3 years ago
parent
commit
c927d82250
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      pyheatpump/cli.py

+ 6
- 2
pyheatpump/cli.py View File

@@ -140,14 +140,18 @@ def fetch():
140 140
 def supervise(since):
141 141
     logger = logger_init()
142 142
 
143
-    from .config import config
143
+    from .config import config, mac_address_init
144
+    mac_address = config.get('heatpump','mac_address')
145
+    if mac_address == 'None':
146
+        mac_address = mac_address_init()
147
+
144 148
     from .models.heatpump import Heatpump
145 149
 
146 150
     last_update = None
147 151
     if since:
148 152
         last_update = int(datetime.now().strftime('%s')) - config.getint('supervisor', 'interval')
149 153
 
150
-    h = Heatpump(config.get('heatpump','mac_address'), last_update)
154
+    h = Heatpump(mac_address, last_update)
151 155
 
152 156
     base_url = {
153 157
         'scheme':config.get('supervisor', 'scheme'),

Loading…
Cancel
Save