|
@@ -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'),
|