Skip to content

Append vera device id to entity id - but not name.#6523

Merged
balloob merged 5 commits into
devfrom
fix_vera_name_bug
Mar 11, 2017
Merged

Append vera device id to entity id - but not name.#6523
balloob merged 5 commits into
devfrom
fix_vera_name_bug

Conversation

@pavoni
Copy link
Copy Markdown
Contributor

@pavoni pavoni commented Mar 11, 2017

Description:

Fix problem in #6100 (comment) that appended the device ids to the name as well as the entity_id.

Related issue (if applicable): fixes #

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

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

If the code communicates with devices, web services, or third-party tools:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@mention-bot
Copy link
Copy Markdown

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

Comment thread homeassistant/components/vera.py Outdated

# Append device id to prevent name clashes in HA.
self._name = self.vera_device.name + ' ' + str(vera_device.device_id)
self.vera_id = VERA_ID_FORMAT.format(slugify(vera_device.name), vera_device.device_id)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (94 > 79 characters)

Copy link
Copy Markdown
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.

Looks good. Nitpicking, I would say that we only use explicit brackets (for tuple) when importing and the imports extend over one line. If imports stay on one line, it's not necessary. Also imports could be alphabetically sorted, also within the same tuple.

@pavoni
Copy link
Copy Markdown
Contributor Author

pavoni commented Mar 11, 2017

Thanks @MartinHjelmare hopefully sorted.

@MartinHjelmare MartinHjelmare added this to the 0.40 milestone Mar 11, 2017
@balloob
Copy link
Copy Markdown
Member

balloob commented Mar 11, 2017

Perfect 🐬

@balloob balloob merged commit 10f5e97 into dev Mar 11, 2017
@balloob balloob deleted the fix_vera_name_bug branch March 11, 2017 18:06
balloob pushed a commit that referenced this pull request Mar 11, 2017
* Append vera device id to entity id - but not name.

* Tidy.

* Tidy.

* Tidy after review.

* Re-order.
@balloob
Copy link
Copy Markdown
Member

balloob commented Mar 11, 2017

cherry-picked for 0.40

@balloob balloob mentioned this pull request Mar 24, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Jun 24, 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