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

Fix unique_id for Tellduslive sensors #19389

Merged
merged 1 commit into from Dec 17, 2018

Conversation

Projects
None yet
4 participants
@fredrike
Copy link
Contributor

fredrike commented Dec 17, 2018

Description:

Some sensors reports the same id, this fixes that.

Related issue (if applicable): fixes #19300

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
@OttoWinter
Copy link
Contributor

OttoWinter left a comment

Is this a breaking change? Are unique IDs that previously worked changed?

@fredrike

This comment has been minimized.

Copy link
Contributor

fredrike commented Dec 17, 2018

Is this a breaking change? Are unique IDs that previously worked changed?

No, it is a fix for a previous break.

@@ -146,4 +146,4 @@ def device_class(self):
@property
def unique_id(self) -> str:
"""Return a unique ID."""
return "-".join(self._id[0:2])
return "-".join(map(str, self._id))

This comment has been minimized.

@balloob

balloob Dec 17, 2018

Member
Suggested change Beta
return "-".join(map(str, self._id))
return "{}-{}".format(*self._id)

This comment has been minimized.

@fredrike

fredrike Dec 17, 2018

Contributor

Python is so cool but this would be better as the fix is due to the length of self._id is 3.

return "{}-{}-{}".format(*self._id)

@balloob balloob merged commit 40d8bd4 into home-assistant:dev Dec 17, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.009%) to 93.018%
Details

@wafflebot wafflebot bot removed the in progress label Dec 17, 2018

dshokouhi added a commit to dshokouhi/home-assistant that referenced this pull request Dec 25, 2018

@balloob balloob referenced this pull request Jan 10, 2019

Merged

0.85.0 #19897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment