Browse Source

[config] auto update mac address if it's value doesnt match the RE

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

+ 1
- 1
pyheatpump/cli.py View File

@@ -151,7 +151,7 @@ def supervise(since):
151 151
 
152 152
     from .config import config, mac_address_init, get_last_update, set_last_update
153 153
     mac_address = config.get('heatpump','mac_address')
154
-    if mac_address == 'None':
154
+    if not re.match('^(([0-9a-f]{2}):?){6}$', mac_address, re.I):
155 155
         mac_address = mac_address_init()
156 156
 
157 157
     from .models.heatpump import Heatpump

Loading…
Cancel
Save