Closed balazs92117 closed 1 year ago
It looks good, thanks for your hard work. Made 1 comment that we should maintain backwards compatibility for now
Also I would skip both 2. and 3. of the TODO list, as I have no idea what would this affect (I checked the HA integration and it is a bit confusing). So I add the new names/references with EON_HU prefix, and use the already existing ones where the name is exactly the same. See the latest commit.
Ok maybe we can do the following, let me know what you think. Ill try to summarize all thoughts in this comment, so i wont clutter the PR too much:
EON_HU_ELECTRICITY_USED_TARIFF_3 = r'^\d-\d:1\.8\.3.+?\r\n'
to ELECTRICITY_USED_TARIFF_1 = r'^\d-\d:1\.8\.1.+?\r\n'
. Same goes for tariff 4. These are general values
{
'obis_reference': obis.P1_MESSAGE_HEADER,
'value_parser': CosemParser(ValueParser(str)),
'value_name': 'P1_MESSAGE_HEADER'
},
Is this possible or am i missing something? And would you want to make all the needed changes?
Nigel
Ah alright, I finally understand what you meant before. Yeah sure I can do this, and I aggree with the suggestions regarding the renames of OBIS references. Let me do it and create a new MR.
Follow up of #134
So I did the followings:
telegram_specifications.py
:objects
fromdict
tolist
of objects (dicts) of the following format:{ 'obis_reference': obis.P1_MESSAGE_HEADER, 'value_parser': CosemParser(ValueParser(str)), 'value_name': 'P1_MESSAGE_HEADER' },
EON_HUNGARY
andSAGEMCOM_T210_D_R
as a test for this discussion.obis_name_mapping.py
:EN
from obis code references to texts, because I couldn't use multiple obis code reference for the same obis code, so it just wouldn't make sense to leave it that way.EN
dict doesn't make much sense, but in the future, if somebody wants to translate this project, (s)he could easily do that.parsers.py
to match the new list->dict format of specifications.//TODO
obis_references.py
from names to obis codes. So e.g.:OBIS_028
instead ofP1_MESSAGE_HEADER
. With this modificaitons the names wouldn't be so confusing, as a lot of specification uses the same obis code for different values (under different name). This is a very big BC, which would break e.g.: Home Assistant integration, so maybe we shouldn't do this in this PR.Q3D_EQUIPMENT_SERIALNUMBER
andEON_HU_EQUIPMENT_SERIAL_NUMBER
toEQUIPMENT_SERIAL_NUMBER
or the lots of*EQUIPMENT_IDENTIFIER
s . Just in the name mappings inEN
, as the obis references are heavily used in e.g.: HA integration.