Skip to content

Commit 75517c9

Browse files
committed
Include device_list in manual-created fixtures
1 parent 532c3b4 commit 75517c9

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

scripts/manual_fixtures.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ def json_writer(manual_name: str, all_data: dict, notifications: dict):
4040
base_adam_manual = "adam_jip"
4141
basefile = f"./fixtures/{base_adam_manual}/all_data.json"
4242
basefile_n = f"./fixtures/{base_adam_manual}/notifications.json"
43+
basefile_d = f"./fixtures/{base_adam_manual}/device_list.json"
4344

4445
io = open(basefile)
4546
base = json.load(io)
47+
io_d = open(basefile_d)
48+
base_d = json.load(io_d)
4649
io_n = open(basefile_n)
4750
base_n = json.load(io_n)
4851

@@ -51,16 +54,19 @@ def json_writer(manual_name: str, all_data: dict, notifications: dict):
5154
# Change mode to off for "1346fbd8498d4dbcab7e18d51b771f3d"
5255
adam_jip["devices"]["1346fbd8498d4dbcab7e18d51b771f3d"]["mode"] = "off"
5356

54-
json_writer("adam_jip", adam_jip, base_n)
57+
json_writer("adam_jip", adam_jip, base_d, base_n)
5558

5659
### Manual Adam fixtures
5760

5861
base_adam_manual = "adam_plus_anna_new"
5962
basefile = f"./fixtures/{base_adam_manual}/all_data.json"
63+
basefile_d = f"./fixtures/{base_adam_manual}/device_list.json"
6064
basefile_n = f"./fixtures/{base_adam_manual}/notifications.json"
6165

6266
io = open(basefile)
6367
base = json.load(io)
68+
io_d = open(basefile_d)
69+
base_d = json.load(io_d)
6470
io_n = open(basefile_n)
6571
base_n = json.load(io_n)
6672

@@ -148,7 +154,7 @@ def json_writer(manual_name: str, all_data: dict, notifications: dict):
148154
"intended_boiler_temperature"
149155
] = 17.5
150156

151-
json_writer("m_adam_cooling", m_adam_cooling, base_n)
157+
json_writer("m_adam_cooling", m_adam_cooling, base_d, base_n)
152158

153159
### FROM ABOVE
154160

@@ -223,19 +229,21 @@ def json_writer(manual_name: str, all_data: dict, notifications: dict):
223229
"resolution": 0.01,
224230
}
225231

226-
json_writer("m_adam_heating", m_adam_heating, base_n)
232+
json_writer("m_adam_heating", m_adam_heating, base_d, base_n)
227233

228234
### ANNA
229235

230236
base_anna_manual = "anna_heatpump_heating"
231237
basefile = f"./fixtures/{base_anna_manual}/all_data.json"
238+
basefile_d = f"./fixtures/{base_anna_manual}/device_list.json"
232239
basefile_n = f"./fixtures/{base_anna_manual}/notifications.json"
233240

234241
io = open(basefile)
235242
base = json.load(io)
243+
io_d = open(basefile_d)
244+
base_d = json.load(io_d)
236245
io_n = open(basefile_n)
237246
base_n = json.load(io_n)
238-
239247
m_anna_heatpump_cooling = base.copy()
240248

241249
# Set cooling_present to true
@@ -299,7 +307,7 @@ def json_writer(manual_name: str, all_data: dict, notifications: dict):
299307
"setpoint_high"
300308
] = 30.0
301309

302-
json_writer("m_anna_heatpump_cooling", m_anna_heatpump_cooling, base_n)
310+
json_writer("m_anna_heatpump_cooling", m_anna_heatpump_cooling, base_d, base_n)
303311

304312
### FROM ABOVE
305313

@@ -342,4 +350,4 @@ def json_writer(manual_name: str, all_data: dict, notifications: dict):
342350
"cooling_activation_outdoor_temperature"
343351
] = 25.0
344352

345-
json_writer("m_anna_heatpump_idle", m_anna_heatpump_idle, base_n)
353+
json_writer("m_anna_heatpump_idle", m_anna_heatpump_idle, base_d, base_n)

0 commit comments

Comments
 (0)