Skip to content

Fix snapcast uuid to be more unique#14925

Merged
MartinHjelmare merged 1 commit intohome-assistant:devfrom
jedi7:pr_snapcast_id2
Jun 12, 2018
Merged

Fix snapcast uuid to be more unique#14925
MartinHjelmare merged 1 commit intohome-assistant:devfrom
jedi7:pr_snapcast_id2

Conversation

@jedi7
Copy link
Copy Markdown
Contributor

@jedi7 jedi7 commented Jun 11, 2018

Current uuid is ok when using only 1 snapserver
New uuid is needed when using multiple snapserver

Because the client can connect to more snapservers and
then uuid based on client MAC is not enough

Description:

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:

  • 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 communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated 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:

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

@ghost ghost added in progress and removed small-pr PRs with less than 30 lines. labels Jun 11, 2018
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 (99 > 79 characters)

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 (99 > 79 characters)

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 (96 > 79 characters)

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 (96 > 79 characters)

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.

Changing the name will change the entity_id, so that will make this a breaking change.

With the unique id set, the entity_id doesn't need to be changed. Both name and entity_id can be customized by the user.

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.

Hmm, I see. Reason for changing it was the same name twice in the tab.
So should I keep the previous name and make renaming inside the registry file?

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.

That's my suggestion. I'm guessing not all users will need to change this if they don't have multiple hosts. So it's better to not make a breaking change and still allow impacted users to set their names and IDs as they want.

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.

ok I changed it :)

Current uuid is ok when using only 1 snapserver
New uuid is needed when using multiple snapserver

Because the client can connect to more snapservers and
then uuid based on client MAC is not enough
@jedi7
Copy link
Copy Markdown
Contributor Author

jedi7 commented Jun 12, 2018

I must changed the way of getting host, port because travis does not like the access of "private" members

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.

Thanks!

Sidenote: Please don't squash commits after review has started. It makes it harder to follow the changes. We will squash via github when merging.

@MartinHjelmare MartinHjelmare merged commit 89d008d into home-assistant:dev Jun 12, 2018
@ghost ghost removed the in progress label Jun 12, 2018
@OttoWinter
Copy link
Copy Markdown
Member

@MartinHjelmare Isn't this a breaking change? When the unique ID changes, the entity registry will generate a new entry for it and thus a new entity ID.

(side note: changing the name of an entity that implements unique_id is AFAIK not a breaking change, as the entity registry keeps entity IDs with the same unique ID static)

@MartinHjelmare
Copy link
Copy Markdown
Member

MartinHjelmare commented Jun 15, 2018

That's true.

But since the unique_id was added five days ago it hasn't been released yet, so it's not a breaking change and my statements above was based on that.

#14895

@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.

5 participants