[config] auto update mac address if it's value doesnt match the RE
This commit is contained in:
parent
a2d3b15138
commit
682c3f6400
1 changed files with 1 additions and 1 deletions
|
|
@ -151,7 +151,7 @@ def supervise(since):
|
||||||
|
|
||||||
from .config import config, mac_address_init, get_last_update, set_last_update
|
from .config import config, mac_address_init, get_last_update, set_last_update
|
||||||
mac_address = config.get('heatpump','mac_address')
|
mac_address = config.get('heatpump','mac_address')
|
||||||
if mac_address == 'None':
|
if not re.match('^(([0-9a-f]{2}):?){6}$', mac_address, re.I):
|
||||||
mac_address = mac_address_init()
|
mac_address = mac_address_init()
|
||||||
|
|
||||||
from .models.heatpump import Heatpump
|
from .models.heatpump import Heatpump
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue