Skip to content
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

Fix name of emby media player #32183

Merged
merged 2 commits into from
Feb 26, 2020

Conversation

springstan
Copy link
Member

@springstan springstan commented Feb 25, 2020

Breaking change

Proposed change

Small fix for the below mentioned issue. Emby integration tries to create an entity with the following entity_id media_player.emby__pyemby__homeassistant.
This fails since words should only be separated by one _. Moreover, the client name is removed as well since it is not necessary.
Now the following entity_id is created successfully media_player.emby_homeassistant.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml
media_player:
  - platform: emby
    host: YOUR_IP_ADDRESS
    api_key: YOUR_API_KEY

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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

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

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@probot-home-assistant
Copy link

Hey there @mezz64, mind taking a look at this pull request as its been labeled with a integration (emby) you are listed as a codeowner for? Thanks!

return (
f"Emby - {self.device.client} - {self.device.name}" or DEVICE_DEFAULT_NAME
)
return f"Emby {self.device.client} {self.device.name}" or DEVICE_DEFAULT_NAME
Copy link
Member

Choose a reason for hiding this comment

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

Remove the client name completely.

@balloob
Copy link
Member

balloob commented Feb 25, 2020

The person who reported that issue is having an invalid entity in their entity registry. That can no longer happen and this PR won't fix the error.

I still think we should merge this PR and drop the client name, as that's an implementation detail.

@mezz64
Copy link
Contributor

mezz64 commented Feb 25, 2020

The client name was originally added to make the entity description as unique as possible. You can change the device name within emby but not the client name (androidtv, roku, etc) so it made it easy to distinguish your devices.

That being said, I don't have a problem with removing it, but it would make this a breaking change since entity names will change for all emby media players.

@springstan
Copy link
Member Author

The person who reported that issue is having an invalid entity in their entity registry.

Curious do we have any documentation on how to delete an invalid entity in the entity registry?

@balloob
Copy link
Member

balloob commented Feb 25, 2020

@mezz64 this is not a breaking change because the entity has a unique ID, so it will only impact the entity ID of new entities.

@codecov
Copy link

codecov bot commented Feb 25, 2020

Codecov Report

Merging #32183 into dev will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev   #32183      +/-   ##
==========================================
- Coverage   94.75%   94.75%   -0.01%     
==========================================
  Files         768      768              
  Lines       55639    55646       +7     
==========================================
+ Hits        52722    52725       +3     
- Misses       2917     2921       +4     
Impacted Files Coverage Δ
...meassistant/components/websocket_api/connection.py 94.44% <0.00%> (-2.78%) ⬇️
...istant/components/google_assistant/report_state.py 83.33% <0.00%> (-1.67%) ⬇️
homeassistant/components/alexa/state_report.py 83.63% <0.00%> (-0.63%) ⬇️
homeassistant/helpers/aiohttp_client.py 95.34% <0.00%> (+0.05%) ⬆️
homeassistant/components/recorder/models.py 93.93% <0.00%> (+0.06%) ⬆️
homeassistant/util/json.py 85.71% <0.00%> (+0.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5488389...a5bb939. Read the comment docs.

@mezz64
Copy link
Contributor

mezz64 commented Feb 25, 2020

@mezz64 this is not a breaking change because the entity has a unique ID, so it will only impact the entity ID of new entities.

Thanks for the refresher. I completely forgot that entity registry rules all now.

@balloob balloob merged commit 58de7fe into home-assistant:dev Feb 26, 2020
@lock lock bot locked and limited conversation to collaborators Feb 28, 2020
@springstan springstan deleted the fix-emby-media-player-name branch April 7, 2020 14:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors with Emby Integration
4 participants