gazpar2haws 0.2.1__tar.gz → 0.3.0b16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.0] - 2025-02-02
9
+
10
+ ### Added
11
+
12
+ [#31](https://github.com/ssenart/gazpar2haws/issues/31): Cost integration.
13
+
8
14
  ## [0.2.1] - 2025-01-24
9
15
 
10
16
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: gazpar2haws
3
- Version: 0.2.1
3
+ Version: 0.3.0b16
4
4
  Summary: Gazpar2HAWS is a gateway that reads data history from the GrDF (French gas provider) meter and send it to Home Assistant using WebSocket interface
5
5
  License: MIT License
6
6
 
@@ -29,6 +29,8 @@ Classifier: Programming Language :: Python :: 3.9
29
29
  Classifier: Programming Language :: Python :: 3.10
30
30
  Classifier: Programming Language :: Python :: 3.11
31
31
  Classifier: Programming Language :: Python :: 3.12
32
+ Requires-Dist: pydantic-extra-types (>=2.10.2,<3.0.0)
33
+ Requires-Dist: pydantic[email] (>=2.10.6,<3.0.0)
32
34
  Requires-Dist: pygazpar (>=1.2.7)
33
35
  Requires-Dist: pyyaml (>=6.0.2)
34
36
  Requires-Dist: websockets (>=14.1)
@@ -216,6 +218,262 @@ The history is uploaded on the entities with names:
216
218
 
217
219
  `${name}` is 'gazpar2haws' defined in the above configuration file. It can be replaced by any other name.
218
220
 
221
+ ### Cost configuration
222
+
223
+ Gazpar2HAWS is able to compute and publish cost history to Home Assistant.
224
+
225
+ The cost computation is based in gas prices defined in the configuration files.
226
+
227
+ The section 'Pricing' is broken into 5 sub-sections:
228
+ - vat: Value added tax definition.
229
+ - consumption_prices: All the gas price history in €/kWh.
230
+ - subscription_prices: The subscription prices in €/month (or year).
231
+ - transport_prices: The fixed prices in €/month (or year) to transport the gas.
232
+ - energy_taxes: Various taxes on energy in €/kWh.
233
+
234
+ Below, many examples illustrates how to use pricing configuration for use cases from the simplest to the most complex.
235
+
236
+
237
+ Example 1: A fixed consumption price
238
+ ---
239
+
240
+ The given price applies at the given date, after and before.
241
+
242
+ The default unit is € per kWh.
243
+
244
+ **Formula:**
245
+ ```math
246
+ cost[€] = quantity[kWh] * price[€/kWh]
247
+ ```
248
+
249
+
250
+ ```yaml
251
+ pricing:
252
+ consumption_prices:
253
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
254
+ value: 0.07790 # Default unit is €/kWh.
255
+ ```
256
+
257
+ Example 2: A fixed consumption price in another unit
258
+ ---
259
+
260
+ *value_unit* is the price unit (default: €).
261
+ *base_unit* is the denominator unit (default: kWh).
262
+
263
+ **Formula:**
264
+ ```math
265
+ cost[€] = \frac{quantity[kWh] * price[¢/MWh] * converter\_factor[¢->€]} {converter\_factor[MWh->kWh]}
266
+ ```
267
+
268
+
269
+ ```yaml
270
+ pricing:
271
+ consumption_prices:
272
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
273
+ value: 7790.0 # Unit is now ¢/MWh.
274
+ value_unit: "¢"
275
+ base_unit: "MWh"
276
+ ```
277
+
278
+ Example 3: Multiple prices over time
279
+ ---
280
+
281
+ ```yaml
282
+ pricing:
283
+ consumption_prices:
284
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
285
+ value: 0.07790 # Default unit is €/kWh.
286
+ - start_date: "2024-01-01"
287
+ value: 0.06888 # Default unit is €/kWh.
288
+ ```
289
+
290
+ Price is 0.07790 before 2024-01-01.
291
+
292
+ Price is 0.06888 on 2024-01-01 and after.
293
+
294
+
295
+ Example 4: Price is given excluding tax
296
+ ---
297
+
298
+ The *normal* value added tax (*vat*) rate is 20%.
299
+
300
+ ```yaml
301
+ pricing:
302
+ vat:
303
+ - id: normal
304
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
305
+ value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
306
+ consumption_prices:
307
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
308
+ value: 0.07790 # Default unit is €/kWh.
309
+ vat_id: "normal" # Reference to the vat rate that is applied for this period.
310
+ ```
311
+
312
+ **Formula:**
313
+ ```math
314
+ cost[€] = quantity[kWh] * price[€/kWh] * (1 + vat[normal])
315
+ ```
316
+
317
+ Example 5: Subscription price
318
+ ---
319
+
320
+ A fixed montly subscription is due over consumption.
321
+
322
+ Subscription *vat* tax may be different than the consumption *vat* tax.
323
+
324
+ ```yaml
325
+ pricing:
326
+ vat:
327
+ - id: normal
328
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
329
+ value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
330
+ - id: reduced
331
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
332
+ value: 0.0550
333
+ consumption_prices:
334
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
335
+ value: 0.07790 # Default unit is €/kWh.
336
+ vat_id: "normal" # Reference to the vat rate that is applied for this period.
337
+ subscription_prices:
338
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
339
+ value: 19.83
340
+ value_unit: "€"
341
+ base_unit: "month"
342
+ vat_id: "reduced"
343
+ ```
344
+
345
+ **Formula:**
346
+ ```math
347
+ cost[€] = quantity[kWh] * cons\_price[€/kWh] * (1 + vat[normal]) + sub\_price * (1 + vat[reduced])
348
+ ```
349
+
350
+
351
+ Example 6: Transport price
352
+ ---
353
+
354
+ A fixed yearly transport may be charged as well.
355
+
356
+ ```yaml
357
+ pricing:
358
+ vat:
359
+ - id: normal
360
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
361
+ value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
362
+ - id: reduced
363
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
364
+ value: 0.0550
365
+ consumption_prices:
366
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
367
+ value: 0.07790 # Default unit is €/kWh.
368
+ vat_id: "normal" # Reference to the vat rate that is applied for this period.
369
+ transport_prices:
370
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
371
+ value: 34.38
372
+ value_unit: "€"
373
+ base_unit: "year"
374
+ vat_id: reduced
375
+ ```
376
+ **Formula:**
377
+ ```math
378
+ cost[€] = quantity[kWh] * cons\_price[€/kWh] * (1 + vat[normal]) + trans\_price * (1 + vat[reduced])
379
+ ```
380
+
381
+ Example 7: Energy taxes
382
+ ---
383
+
384
+ Consumption may be taxed by additional taxes (known as energy taxes).
385
+
386
+ ```yaml
387
+ pricing:
388
+ vat:
389
+ - id: normal
390
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
391
+ value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
392
+ - id: reduced
393
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
394
+ value: 0.0550
395
+ consumption_prices:
396
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
397
+ value: 0.07790 # Default unit is €/kWh.
398
+ vat_id: "normal" # Reference to the vat rate that is applied for this period.
399
+ energy_taxes:
400
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
401
+ value: 0.00837
402
+ value_unit: "€"
403
+ base_unit: "kWh"
404
+ vat_id: normal
405
+ ```
406
+ **Formula:**
407
+ ```math
408
+ cost[€] = quantity[kWh] * (cons\_price[€/kWh] + ener\_taxes[€/kWh])* (1 + vat[normal])
409
+ ```
410
+
411
+ Example 8: All in one
412
+ ---
413
+
414
+ In the price list, the first item properties are propagated to the next items in the list. If their values does not change, it is not required to repeat them.
415
+
416
+ ```yaml
417
+ pricing:
418
+ vat:
419
+ - id: reduced
420
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
421
+ value: 0.0550
422
+ - id: normal
423
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
424
+ value: 0.20
425
+ consumption_prices:
426
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
427
+ value: 0.07790
428
+ value_unit: "€"
429
+ base_unit: "kWh"
430
+ vat_id: normal
431
+ - start_date: "2023-07-01"
432
+ value: 0.05392
433
+ - start_date: "2023-08-01"
434
+ value: 0.05568
435
+ - start_date: "2023-09-01"
436
+ value: 0.05412
437
+ - start_date: "2023-10-01"
438
+ value: 0.06333
439
+ - start_date: "2023-11-01"
440
+ value: 0.06716
441
+ - start_date: "2023-12-01"
442
+ value: 0.07235
443
+ - start_date: "2024-01-01"
444
+ value: 0.06888
445
+ - start_date: "2024-02-01"
446
+ value: 0.05972
447
+ - start_date: "2024-03-01"
448
+ value: 0.05506
449
+ - start_date: "2024-04-01"
450
+ value: 0.04842
451
+ - start_date: "2025-01-01"
452
+ value: 0.07807
453
+ subscription_prices:
454
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
455
+ value: 19.83
456
+ value_unit: "€"
457
+ base_unit: "month"
458
+ vat_id: reduced
459
+ - start_date: "2023-07-01"
460
+ value: 20.36
461
+ transport_prices:
462
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
463
+ value: 34.38
464
+ value_unit: "€"
465
+ base_unit: "year"
466
+ vat_id: reduced
467
+ energy_taxes:
468
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
469
+ value: 0.00837
470
+ value_unit: "€"
471
+ base_unit: "kWh"
472
+ vat_id: normal
473
+ - start_date: "2024-01-01"
474
+ value: 0.01637
475
+ ```
476
+
219
477
  ### Environment variable for Docker
220
478
 
221
479
  In a Docker environment, the configurations files are instantiated by replacing the environment variables below in the template files:
@@ -180,6 +180,262 @@ The history is uploaded on the entities with names:
180
180
 
181
181
  `${name}` is 'gazpar2haws' defined in the above configuration file. It can be replaced by any other name.
182
182
 
183
+ ### Cost configuration
184
+
185
+ Gazpar2HAWS is able to compute and publish cost history to Home Assistant.
186
+
187
+ The cost computation is based in gas prices defined in the configuration files.
188
+
189
+ The section 'Pricing' is broken into 5 sub-sections:
190
+ - vat: Value added tax definition.
191
+ - consumption_prices: All the gas price history in €/kWh.
192
+ - subscription_prices: The subscription prices in €/month (or year).
193
+ - transport_prices: The fixed prices in €/month (or year) to transport the gas.
194
+ - energy_taxes: Various taxes on energy in €/kWh.
195
+
196
+ Below, many examples illustrates how to use pricing configuration for use cases from the simplest to the most complex.
197
+
198
+
199
+ Example 1: A fixed consumption price
200
+ ---
201
+
202
+ The given price applies at the given date, after and before.
203
+
204
+ The default unit is € per kWh.
205
+
206
+ **Formula:**
207
+ ```math
208
+ cost[€] = quantity[kWh] * price[€/kWh]
209
+ ```
210
+
211
+
212
+ ```yaml
213
+ pricing:
214
+ consumption_prices:
215
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
216
+ value: 0.07790 # Default unit is €/kWh.
217
+ ```
218
+
219
+ Example 2: A fixed consumption price in another unit
220
+ ---
221
+
222
+ *value_unit* is the price unit (default: €).
223
+ *base_unit* is the denominator unit (default: kWh).
224
+
225
+ **Formula:**
226
+ ```math
227
+ cost[€] = \frac{quantity[kWh] * price[¢/MWh] * converter\_factor[¢->€]} {converter\_factor[MWh->kWh]}
228
+ ```
229
+
230
+
231
+ ```yaml
232
+ pricing:
233
+ consumption_prices:
234
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
235
+ value: 7790.0 # Unit is now ¢/MWh.
236
+ value_unit: "¢"
237
+ base_unit: "MWh"
238
+ ```
239
+
240
+ Example 3: Multiple prices over time
241
+ ---
242
+
243
+ ```yaml
244
+ pricing:
245
+ consumption_prices:
246
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
247
+ value: 0.07790 # Default unit is €/kWh.
248
+ - start_date: "2024-01-01"
249
+ value: 0.06888 # Default unit is €/kWh.
250
+ ```
251
+
252
+ Price is 0.07790 before 2024-01-01.
253
+
254
+ Price is 0.06888 on 2024-01-01 and after.
255
+
256
+
257
+ Example 4: Price is given excluding tax
258
+ ---
259
+
260
+ The *normal* value added tax (*vat*) rate is 20%.
261
+
262
+ ```yaml
263
+ pricing:
264
+ vat:
265
+ - id: normal
266
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
267
+ value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
268
+ consumption_prices:
269
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
270
+ value: 0.07790 # Default unit is €/kWh.
271
+ vat_id: "normal" # Reference to the vat rate that is applied for this period.
272
+ ```
273
+
274
+ **Formula:**
275
+ ```math
276
+ cost[€] = quantity[kWh] * price[€/kWh] * (1 + vat[normal])
277
+ ```
278
+
279
+ Example 5: Subscription price
280
+ ---
281
+
282
+ A fixed montly subscription is due over consumption.
283
+
284
+ Subscription *vat* tax may be different than the consumption *vat* tax.
285
+
286
+ ```yaml
287
+ pricing:
288
+ vat:
289
+ - id: normal
290
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
291
+ value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
292
+ - id: reduced
293
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
294
+ value: 0.0550
295
+ consumption_prices:
296
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
297
+ value: 0.07790 # Default unit is €/kWh.
298
+ vat_id: "normal" # Reference to the vat rate that is applied for this period.
299
+ subscription_prices:
300
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
301
+ value: 19.83
302
+ value_unit: "€"
303
+ base_unit: "month"
304
+ vat_id: "reduced"
305
+ ```
306
+
307
+ **Formula:**
308
+ ```math
309
+ cost[€] = quantity[kWh] * cons\_price[€/kWh] * (1 + vat[normal]) + sub\_price * (1 + vat[reduced])
310
+ ```
311
+
312
+
313
+ Example 6: Transport price
314
+ ---
315
+
316
+ A fixed yearly transport may be charged as well.
317
+
318
+ ```yaml
319
+ pricing:
320
+ vat:
321
+ - id: normal
322
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
323
+ value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
324
+ - id: reduced
325
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
326
+ value: 0.0550
327
+ consumption_prices:
328
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
329
+ value: 0.07790 # Default unit is €/kWh.
330
+ vat_id: "normal" # Reference to the vat rate that is applied for this period.
331
+ transport_prices:
332
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
333
+ value: 34.38
334
+ value_unit: "€"
335
+ base_unit: "year"
336
+ vat_id: reduced
337
+ ```
338
+ **Formula:**
339
+ ```math
340
+ cost[€] = quantity[kWh] * cons\_price[€/kWh] * (1 + vat[normal]) + trans\_price * (1 + vat[reduced])
341
+ ```
342
+
343
+ Example 7: Energy taxes
344
+ ---
345
+
346
+ Consumption may be taxed by additional taxes (known as energy taxes).
347
+
348
+ ```yaml
349
+ pricing:
350
+ vat:
351
+ - id: normal
352
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
353
+ value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
354
+ - id: reduced
355
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
356
+ value: 0.0550
357
+ consumption_prices:
358
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
359
+ value: 0.07790 # Default unit is €/kWh.
360
+ vat_id: "normal" # Reference to the vat rate that is applied for this period.
361
+ energy_taxes:
362
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
363
+ value: 0.00837
364
+ value_unit: "€"
365
+ base_unit: "kWh"
366
+ vat_id: normal
367
+ ```
368
+ **Formula:**
369
+ ```math
370
+ cost[€] = quantity[kWh] * (cons\_price[€/kWh] + ener\_taxes[€/kWh])* (1 + vat[normal])
371
+ ```
372
+
373
+ Example 8: All in one
374
+ ---
375
+
376
+ In the price list, the first item properties are propagated to the next items in the list. If their values does not change, it is not required to repeat them.
377
+
378
+ ```yaml
379
+ pricing:
380
+ vat:
381
+ - id: reduced
382
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
383
+ value: 0.0550
384
+ - id: normal
385
+ start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
386
+ value: 0.20
387
+ consumption_prices:
388
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
389
+ value: 0.07790
390
+ value_unit: "€"
391
+ base_unit: "kWh"
392
+ vat_id: normal
393
+ - start_date: "2023-07-01"
394
+ value: 0.05392
395
+ - start_date: "2023-08-01"
396
+ value: 0.05568
397
+ - start_date: "2023-09-01"
398
+ value: 0.05412
399
+ - start_date: "2023-10-01"
400
+ value: 0.06333
401
+ - start_date: "2023-11-01"
402
+ value: 0.06716
403
+ - start_date: "2023-12-01"
404
+ value: 0.07235
405
+ - start_date: "2024-01-01"
406
+ value: 0.06888
407
+ - start_date: "2024-02-01"
408
+ value: 0.05972
409
+ - start_date: "2024-03-01"
410
+ value: 0.05506
411
+ - start_date: "2024-04-01"
412
+ value: 0.04842
413
+ - start_date: "2025-01-01"
414
+ value: 0.07807
415
+ subscription_prices:
416
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
417
+ value: 19.83
418
+ value_unit: "€"
419
+ base_unit: "month"
420
+ vat_id: reduced
421
+ - start_date: "2023-07-01"
422
+ value: 20.36
423
+ transport_prices:
424
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
425
+ value: 34.38
426
+ value_unit: "€"
427
+ base_unit: "year"
428
+ vat_id: reduced
429
+ energy_taxes:
430
+ - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
431
+ value: 0.00837
432
+ value_unit: "€"
433
+ base_unit: "kWh"
434
+ vat_id: normal
435
+ - start_date: "2024-01-01"
436
+ value: 0.01637
437
+ ```
438
+
183
439
  ### Environment variable for Docker
184
440
 
185
441
  In a Docker environment, the configurations files are instantiated by replacing the environment variables below in the template files:
@@ -3,8 +3,9 @@ import asyncio
3
3
  import logging
4
4
  import traceback
5
5
 
6
- from gazpar2haws import __version__, config_utils
6
+ from gazpar2haws import __version__
7
7
  from gazpar2haws.bridge import Bridge
8
+ from gazpar2haws.configuration import Configuration
8
9
 
9
10
  Logger = logging.getLogger(__name__)
10
11
 
@@ -16,9 +17,7 @@ async def main():
16
17
  prog="gazpar2haws",
17
18
  description="Gateway that reads data history from the GrDF (French gas provider) meter and send it to Home Assistant using WebSocket interface.",
18
19
  )
19
- parser.add_argument(
20
- "-v", "--version", action="version", version="Gazpar2HAWS version"
21
- )
20
+ parser.add_argument("-v", "--version", action="version", version="Gazpar2HAWS version")
22
21
  parser.add_argument(
23
22
  "-c",
24
23
  "--config",
@@ -38,17 +37,15 @@ async def main():
38
37
 
39
38
  try:
40
39
  # Load configuration files
41
- config = config_utils.ConfigLoader(args.config, args.secrets)
42
- config.load_secrets()
43
- config.load_config()
40
+ config = Configuration.load(args.config, args.secrets)
44
41
 
45
42
  print(f"Gazpar2HAWS version: {__version__}")
46
43
 
47
44
  # Set up logging
48
- logging_file = config.get("logging.file")
49
- logging_console = bool(config.get("logging.console"))
50
- logging_level = config.get("logging.level")
51
- logging_format = config.get("logging.format")
45
+ logging_file = config.logging.file
46
+ logging_console = config.logging.console
47
+ logging_level = config.logging.level
48
+ logging_format = config.logging.format
52
49
 
53
50
  # Convert logging level to integer
54
51
  if logging_level.upper() == "DEBUG":
@@ -70,9 +67,7 @@ async def main():
70
67
  # Add a console handler manually
71
68
  console_handler = logging.StreamHandler()
72
69
  console_handler.setLevel(level) # Set logging level for the console
73
- console_handler.setFormatter(
74
- logging.Formatter(logging_format)
75
- ) # Customize console format
70
+ console_handler.setFormatter(logging.Formatter(logging_format)) # Customize console format
76
71
 
77
72
  # Get the root logger and add the console handler
78
73
  logging.getLogger().addHandler(console_handler)
@@ -91,12 +86,10 @@ async def main():
91
86
  return 0
92
87
 
93
88
  except Exception: # pylint: disable=broad-except
94
- errorMessage = (
95
- f"An error occured while running Gazpar2HAWS: {traceback.format_exc()}"
96
- )
89
+ errorMessage = f"An error occured while running Gazpar2HAWS: {traceback.format_exc()}"
97
90
  Logger.error(errorMessage)
98
91
  print(errorMessage)
99
- return 1
92
+ raise
100
93
 
101
94
 
102
95
  # ----------------------------------