Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor of name mapping, added E.ON Hungary #137

Merged
merged 17 commits into from
Aug 1, 2023

Conversation

balazs92117
Copy link
Contributor

@balazs92117 balazs92117 commented Jul 30, 2023

So let's try it again :)

Follow up of #134 and #136

Notes:

  1. Pls help me with the last failing unit test, I do not understand what happens there.

object["value_parser"]
for object in v5_objects
if object["obis_reference"] == obis_references.DEVICE_TYPE
][0]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, here we don't have the key anymore. I don't think we really need one, but we could reintroduce it by structuring it like so:

{
        obis.EQUIPMENT_IDENTIFIER:
        {
            'value_parser': CosemParser(ValueParser(str)),
            'value_name': 'EQUIPMENT_IDENTIFIER'
        },

But im fine with leaving it like this. The advantage is that we don't have a single dict structure where keys can conflict

@ndokter
Copy link
Owner

ndokter commented Jul 30, 2023

Thats a lot of refactoring! Thanks for the hard work. I've looked through it and i don't see anything to comment on. Did you want to add anything or can we merge the changes?

If so, i will do so on a later time

@balazs92117
Copy link
Contributor Author

I think its fine, and it can be merged. Thank you for this repo and your work! :)

@ndokter ndokter merged commit 2f1e080 into ndokter:master Aug 1, 2023
5 checks passed
@ndokter
Copy link
Owner

ndokter commented Aug 1, 2023

I've put your changes in 1.3.0 (https://pypi.org/project/dsmr-parser/) thanks again!

'checksum_support': True,
'objects': {
obis.P1_MESSAGE_TIMESTAMP: CosemParser(ValueParser(timestamp)),
obis.LUXEMBOURG_EQUIPMENT_IDENTIFIER: CosemParser(ValueParser(str)), # "COSEM logical equipment name"
obis.EQUIPMENT_IDENTIFIER_GAS: CosemParser(ValueParser(str)), # This obis is already defined, so it is not possible to "rename" it to "EQUIPMENT_SERIAL_NUMBER"
obis.ELECTRICITY_ACTIVE_TARIFF: CosemParser(ValueParser(str)),
obis.EON_HU_CIRCUIT_BREAKER_STATUS: CosemParser(ValueParser(str)), # Does not show up always
obis.ACTUAL_SWITCH_POSITION: CosemParser(ValueParser(str)), # This seems to be wrong in documentation, it's not 0-0:96.50.68, but 0-0:96.3.10

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be manufacturer specific. At least one instance of Sanxing SX631 (S34U18) follows the documentation: 0-0:96.50.68(ON) #136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants