-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
Squeezebox: Keep track of already added players #7149
Conversation
@molobrakos, thanks for your PR! By analyzing the history of the files in this pull request, we identified @persandstrom, @dasos and @fabaff to be potential reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look to sonos and use unique_id from entity to handle that.
005eb49
to
210939d
Compare
|
||
if players['playerid'] in [x.unique_id | ||
for x in self.hass.data[DATA_SQUEEZEBOX]]: | ||
_LOGGER.debug('Skipping player %s because already seen', players['playerid']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (93 > 79 characters)
@@ -108,10 +100,17 @@ def create_players(self): | |||
data = yield from self.async_query('players', 'status') | |||
|
|||
for players in data['players_loop']: | |||
|
|||
if players['playerid'] in [x.unique_id | |||
for x in self.hass.data[DATA_SQUEEZEBOX]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (81 > 79 characters)
210939d
to
2a949e2
Compare
2a949e2
to
c6842a0
Compare
c6842a0
to
f9c691e
Compare
@pvizeli , thanks for pointing that out. I can see that implementing the Let me know if it still is preferred to locally keep track of already added entities inside the platform (e.g. storing in |
Description:
Keep track of already added players.
When running hass e.g. inside a docker container using the bridge network, a squeezeserver might be discovered multiple times on multiple networks.
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:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass