|
@@ -57,15 +57,14 @@ def run(host, port):
|
57
|
57
|
workers=1)
|
58
|
58
|
|
59
|
59
|
|
60
|
|
-@click.option('--type', '-t', default=None, multiple=True)
|
61
|
|
-@cli.command()
|
62
|
|
-def fetch(type):
|
|
60
|
+
|
|
61
|
+def fetch(types=[]):
|
63
|
62
|
logger = logger_init()
|
64
|
63
|
|
65
|
64
|
from pyheatpump import modbus
|
66
|
65
|
|
67
|
66
|
try:
|
68
|
|
- if type is None:
|
|
67
|
+ if len(types) == 0:
|
69
|
68
|
var_types = VariableType.getall()
|
70
|
69
|
else:
|
71
|
70
|
var_types = {}
|
|
@@ -158,7 +157,6 @@ def fetch(type):
|
158
|
157
|
|
159
|
158
|
|
160
|
159
|
|
161
|
|
-@click.option('--since', is_flag=True)
|
162
|
160
|
@cli.command()
|
163
|
161
|
def supervise(since):
|
164
|
162
|
logger = logger_init()
|
|
@@ -204,7 +202,8 @@ def supervise(since):
|
204
|
202
|
else:
|
205
|
203
|
logger.warn('Unable to set data from supervisor\n{}'.format(control_data))
|
206
|
204
|
|
207
|
|
- time.sleep(3)
|
|
205
|
+ # Récupération de toutes les variables en modbus
|
|
206
|
+ fetch()
|
208
|
207
|
|
209
|
208
|
post_packets = [
|
210
|
209
|
Heatpump(mac_address, last_update, ['Analog']).packet,
|