add support for Kodi discovery#13790
Merged
balloob merged 5 commits intohome-assistant:devfrom Apr 14, 2018
Merged
Conversation
2 tasks
balloob
reviewed
Apr 10, 2018
| async_add_devices([entity], update_before_add=True) | ||
| hass.data[DATA_KODI] = dict() | ||
|
|
||
| # Is this a manual configuration? |
Member
There was a problem hiding this comment.
Just check based on if discovery_info is None or not.
Contributor
Author
There was a problem hiding this comment.
This "workflow" was copied from media_player/samsungtv. First I would do it like you say but then thought there is maybe a reason.
balloob
reviewed
Apr 10, 2018
| # Only add a device once, so discovered devices do not override manual | ||
| # config. | ||
| ip_addr = socket.gethostbyname(host) | ||
| if ip_addr not in hass.data[DATA_KODI]: |
Member
There was a problem hiding this comment.
Just return.
if ip_addr in hass.data[DATA_KODI]:
return
Contributor
Author
There was a problem hiding this comment.
Ahh OK, now I can see your point. The return is missing for else. But why shouldn't there be a log message?
Member
There was a problem hiding this comment.
The log message should be removed or at least be downgraded to debug. It is already logging that the entity is added.
Member
|
You should only register the services the first time the platform is set up. |
balloob
approved these changes
Apr 14, 2018
Member
|
Awesome, thanks 👍 |
pvizeli
added a commit
that referenced
this pull request
Apr 15, 2018
* Revert "Add unique_id for BMW ConnectedDrive (#13888)" This reverts commit 9014e26. * Revert "Added snips service descriptions (#13883)" This reverts commit 1c4da0c. * Revert "Fix race condition for component loaded before listening (#13887)" This reverts commit bba997e. * Revert "Missing property decorator added (#13889)" This reverts commit bf98b79. * Revert "Update frontend to 20180414.0" This reverts commit 1617fbe. * Revert "Further untangle data entry flow (#13855)" This reverts commit 4d44c0f. * Revert "add support for Kodi discovery (#13790)" This reverts commit 5a5dad6. * Revert "Update yweather.py (#13851)" This reverts commit c3388d6.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Add support for discovering of Kodi media players.
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5144
Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed: