Skip to content

Commit

Permalink
Handle missing id when decoding #8
Browse files Browse the repository at this point in the history
  • Loading branch information
toreamun committed Apr 20, 2022
1 parent 1589168 commit ae36b69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion han/dlde.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ def decode_p1_readout(readout: DataReadout) -> dict[str, str | int | float | dat
decoded[
obis_map.FIELD_METER_MANUFACTURER_ID
] = readout.identification_line.manufacturer_id
decoded[obis_map.FIELD_METER_TYPE_ID] = readout.identification_line.identification
if readout.identification_line.identification is not None:
decoded[
obis_map.FIELD_METER_TYPE_ID
] = readout.identification_line.identification

return decoded
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="amshan",
version="2.0.4",
version="2.0.5",
author="Tore Amundsen",
author_email="tore@amundsen.org",
description="Decode P1 and MBUS (Meter Bus) DLMS data. Special support for norwegian and swedish meters.",
Expand Down
1 change: 0 additions & 1 deletion tests/test_dlde.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ def test_decode_kamstrup(self):
"current_l3": 1.4,
"meter_datetime": datetime(2022, 4, 8, 13, 50, 21),
"meter_manufacturer_id": "KAM",
"meter_type_id": None,
"reactive_power_export": 505,
"reactive_power_export_l1": 204,
"reactive_power_export_l2": 95,
Expand Down

0 comments on commit ae36b69

Please sign in to comment.