Skip to content

Allow configuring DSMR5 protocol.#7535

Merged
pvizeli merged 4 commits into
home-assistant:devfrom
aequitas:dsmr5
May 29, 2017
Merged

Allow configuring DSMR5 protocol.#7535
pvizeli merged 4 commits into
home-assistant:devfrom
aequitas:dsmr5

Conversation

@aequitas
Copy link
Copy Markdown
Contributor

@aequitas aequitas commented May 10, 2017

Todo's:

  • live testing
  • fix dsmr_parser support for v5

@mention-bot
Copy link
Copy Markdown

@aequitas, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fabaff, @balloob and @pvizeli to be potential reviewers.

Comment thread homeassistant/components/sensor/dsmr.py Outdated

# Protocol version specific obis
if dsmr_version == '4':
if dsmr_version in ['4', '5']:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use a set instead a list, that is faster

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For lists this size there is no significant difference as far as I can measure.

import timeit
>>> timeit.timeit(stmt='"4" in a', setup='a = ("4","5")', number=100000)
0.0047658109997428255
>>> timeit.timeit(stmt='"4" in a', setup='a = ["4","5"]', number=100000)
0.004662344001189922
>>> timeit.timeit(stmt='"2.2" in a', setup='a = ("4","5")', number=100000)
0.0070196070009842515
>>> timeit.timeit(stmt='"2.2" in a', setup='a = ["4","5"]', number=100000)
0.00696941199930734

@aequitas
Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

Ok to merge when @aequitas has tested it 👍

@aequitas
Copy link
Copy Markdown
Contributor Author

Still waiting for feedback from DSMR5 testers.

@pvizeli pvizeli merged commit 5e5c0da into home-assistant:dev May 29, 2017
@aequitas
Copy link
Copy Markdown
Contributor Author

One user reported in and current implementation does not work. Waiting for debug output. Will create new PR for additional changes. Assumption is this change does not break anything for non DSMR5 users so should be safe to keep merged.

@balloob balloob mentioned this pull request Jun 2, 2017
@syphernl syphernl mentioned this pull request Jun 4, 2017
@aequitas aequitas mentioned this pull request Jun 4, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Sep 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants