-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fail when connecting to "Habitación principal" #5
Comments
|
Thanks for opening an issue and providing logs with your report. To fix your issue, please use the latest version on PyPI: pip3 install chromecast_mpris==0.2.6 Using this version, I renamed my Chromecast to "Habitación principal" and was able to use ~ ❯ chromecast_mpris -n "Habitación principal"
INFO:pychromecast:Querying device status
INFO:mpris_server.server:MPRIS server connected to D-Bus session bus
INFO:pychromecast.controllers:Receiver:setting volume to 1.0 |
Awesome, glad it worked! I'll look into the MPRIS and D-Bus spec to see if it allows for accented characters. As a compatibility mitigation, |
So I looked into the MPRIS spec, and it has this to say about interface names:
Right now As this isn't an issue that I'll run into, I do want to solve it in a way that makes sense to users who do run into it. Options as I see them are:
Option 2 is a problem of enumerating i18n edge cases and replacing them with valid ASCII characters. That's something that I'd rather avoid, so I'm leaning on option 4 by allowing the user to override the interface name via the CLI. Does that seem like a good solution, @vlad88sv? |
Thank you so much for the research effort!!! I would say #2 would be lovely from a user experience perspective, and #4 is like a good option to have irregardless of #2 being implemented, just my 2cts. #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from unicodedata import normalize
trans_tab = dict.fromkeys(map(ord, u'\u0301\u0308'), None)
s="Habitación principal"
s = normalize('NFKC', normalize('NFKD', s).translate(trans_tab))
print(s) This outputs: |
Thanks for the code example, I played with it and it made me reconsider option 2. I found Unidecode, which suits this use case well and I implemented it in You can try it out by upgrading both via pip: pip3 install chromecast_mpris==0.2.8 mpris_server==0.2.8 I haven't tested it out with a Chromecast with an accent in its name, though. If you find the time, try it out and let me know how it goes. edit: the correct version is 0.2.8, not 0.2.7 |
Awesome, glad to hear it! I'm going to close this issue, please feel free to comment or re-open it should anyone encounter this issue again. |
Hi, thank you for making available your project!
I have an issue when attempting:
chromecast_mpris -n "Habitación principal"
On Chrome this works OK:
Does this tool support tilde (áéíóú) in the name?
The text was updated successfully, but these errors were encountered: