Refactored and updated dsmr_parser

This commit is contained in:
Ard Kuijpers
2025-03-22 17:20:52 +01:00
parent 53022aebb8
commit ccb31cbdc1
21 changed files with 731 additions and 69 deletions

18
tests/dsmr_parser_test.py Normal file
View File

@@ -0,0 +1,18 @@
# DSMR v4.2 p1 using dsmr_parser and telegram objects
from dsmr_parser import telegram_specifications
from dsmr_parser.clients import SerialReader, SERIAL_SETTINGS_V5
import os
serial_reader = SerialReader(
device='/dev/ttyUSB0',
serial_settings=SERIAL_SETTINGS_V5,
telegram_specification=telegram_specifications.V5
)
# telegram = next(serial_reader.read_as_object())
# print(telegram)
for telegram in serial_reader.read_as_object():
os.system('clear')
print(telegram)