Closed maxileith closed 2 months ago
German "Umlaute" are alphanumeric characters. It is obvious that Apple allows "Umlaute" as other officially supported systems like Hue allow "Umlaute" as well. Even an Apple TV can be renamed to something with an Umlaut in it.
For reference, here are all lowercase / uppercase letters that are officially part of unicode:
https://www.compart.com/en/unicode/category/Ll
https://www.compart.com/en/unicode/category/Lu
Pretty much the whole world besides the English speaking countries uses a few more characters which are just required to name things properly.
And yes these character sets even include some emoji-like characters like ℹ. If you try to rename a native AppleTV device to this (in the home app), you will see that it does work. When you use another emoji like 🤪 (not part of Unicode Ll), you will see that it return an error.
+1
This is another recently introduced bug, very annoying.
I will add a config option to disable this, however this is not a bug. this is a recommendation by Apple which you will not be following.
okay latest beta has this config.
This is definitely a bug. You are assuming that alphanumeric characters are only ASCII characters 0-127, though there are more alphanumeric characters like I have written. The filter mechanism in the home app itself is considering all the Unicode character sets that I have mentioned above as compliant.
Sadly the HomeKit documentation is a bit unspecific there. However, in the swift documentation which HomeKit probably builds up on, the character sets that I have mentioned above are used:
https://developer.apple.com/documentation/foundation/characterset/1779927-capitalizedletters
https://developer.apple.com/documentation/foundation/characterset/1779880-uppercaseletters
Just for reference:
If you use a German Umlaut there won't be an error:
If you use an actual forbidden character, there will be the following error (which basically says that there is a bad character)
just referencing this again for you.
@donavanbecker I don't see no conflict with my statement. But actually the documentation supports my statement. The documentation says in a very general way that the names of devices should describe the purpose of the device and should follow the rules:
The Unicode character sets I have provided don't violate a single rule. Besides the emoji-like characters maybe. But in general these are the allowed characters that are used by the original filter mechanism in the home app. At least from I what I can tell from a sample of chars.
Maybe it is difficult to understand for an English speaking person, BUT the rest of the world uses characters that aren't in the ASCII 0-127 range. E.g., it is just not possible to name a door correctly without "ü" in the German language.
So the new filter that you have implemented will cause problems for everybody but english-speaking guys.
If I ask my Siri to open my front door: "Haustür öffnen", Siri won't open the front door as Siri knows the front door as "Haustr".
Maybe I need to ask another way ... what makes you think based on the Documentation that you have linked that ü is not allowed?
@maxileith you have the config. At this time I am not changing the plugin. If you upgraded to the beta Homebridge you would see the warning as well.
If you upgraded to the beta Homebridge you would see the warning as well.
Yep, you are right. However, only until this fix will be rolled out with homebridge: https://github.com/homebridge/HAP-NodeJS/commit/380b879b139a8baf9febbdbb4301eb96d0e26b22
So the wrong check has already been fixed in HAP-NodeJS. I think it is time to fix it in the SwitchBot plugin as well. I should have linked the commit from the beginning. I just weren't aware of that commit until now.
Yep, you are right. However, only until this fix will be rolled out with homebridge: https://github.com/homebridge/HAP-NodeJS/commit/380b879b139a8baf9febbdbb4301eb96d0e26b22
This is already in the a
Latest HAP-NodeJS 1.x
and in the 2.0.0-beta.8
So the wrong check has already been fixed in HAP-NodeJS. I think it is time to fix it in the SwitchBot plugin as well. I should have linked the commit from the beginning. I just weren't aware of that commit until now.
I will make this change and see if you're satisfied
Yep, you are right. However, only until this fix will be rolled out with homebridge: homebridge/HAP-NodeJS@380b879 This is already in the Latest HAP-NodeJS 1.x and in the 2.0.0-beta.8
Yes, this is why there is no warning with the beta versions. In 1.8.4 there is still a warning as the updated regex has not been published yet.
I will make this change and see if you're satisfied.
Thank you. All the fellas which are non-english speakers and have weirdo alphanumeric characters like àáâäǎæ will thank you. I think it is good to align with the homebridge checks. I hope you are also satisfied with the change. Honestly, seems not to be the case ... I was hoping I could make clear how important the change is.
Yes, this is why there is no warning with the beta versions. In 1.8.4 there is still a warning as the updated regex has not been published yet.
I was still getting warnings and so that is why I implemented this so it would automatically remove bad characters.
Thank you. All the fellas which are non-english speakers and have weirdo alphanumeric characters like àáâäǎæ will thank you. I think it is good to align with the homebridge checks. I hope you are also satisfied with the change. Honestly, seems not to be the case ... I was hoping I could make clear how important the change is.
I am satisfied as I an agree with staying inline. Looks like I didn't implement it the same way though, sorry about that. Also glad this forced me to add a config option, I wasn't thinking about that allows the end users to have bad names as that is their choice then.
Can you try the latest beta:
Works like a charm.
Works like a charm.
Thanks for your feedback!
Describe the Bug
German "Umlaute" (Ä, ä, Ö, ö, Ü, ü, ß) are allowed as characters in HomeKit device names. However, the plugin removes them every time I try to rename the device.
To Reproduce
Expected Behavior
Umlaute aren’t filtered
Relevant Log Output
Config for homebridge-switchbot
Screenshots
No response
Device and Model
SwitchBot
Node.js Version
v20.16.0
NPM Version
v10
Homebridge Version
v1.8.4
Homebridge Switchbot Plugin Version
v3.7.0
Homebridge Config UI X Plugin Version
No response
Operating System
Linux / Docker