Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add unique_id for mqtt binary sensor #14929

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

Merged
merged 2 commits into from
Jun 13, 2018
Merged

Add unique_id for mqtt binary sensor #14929

merged 2 commits into from
Jun 13, 2018

Conversation

ciotlosm
Copy link
Contributor

@ciotlosm ciotlosm commented Jun 11, 2018

Description:

Added unique_id for mqtt binary sensor. Use case for zigbee2mqtt to allow renaming just like xiaomi_aqara.

Related issue (if applicable): fixes #

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5538

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Complete the test, otherwise looks good!

'unique_id': 'TOTALLY_UNIQUE'
}]
})

Copy link
Member

Choose a reason for hiding this comment

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

We should test the unique id functionality by firing an mqtt message. See sensor mqtt tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies, when splitting I missed a few lines and unfortunately test passed without those. I'll be more attentive on next split.

@ciotlosm
Copy link
Contributor Author

@MartinHjelmare Fixed test and added documentation as well.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Great!

@MartinHjelmare MartinHjelmare changed the title Added unique_id for mqtt binary sensor Add unique_id for mqtt binary sensor Jun 13, 2018
@MartinHjelmare MartinHjelmare merged commit 08adfd8 into home-assistant:dev Jun 13, 2018
@ghost ghost removed the in progress label Jun 13, 2018
@balloob balloob mentioned this pull request Jun 22, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
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.

3 participants