-
-
Notifications
You must be signed in to change notification settings - Fork 629
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: Update characteristic naming convention warning message text and associated tests. #1054
Conversation
… associated tests.
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.
Thanks!
The regex in here "/^[\p{L}\p{N}][\p{L}\p{N} ']*[\p{L}\p{N}]$/u" is too tightly limited and is excluding/warning on valid HomeKit characters in names ie: - Suggest maybe -,. are still valid in HomeKit Names |
They are not valid characters in names. The examples should be updated. While HomeKit may accept stuff that is invalid, it’s still invalid and it is correct to warn users accordingly. 😄 The only valid names within HomeKit, straight from the source:
If you can point me to more current documentation from Apple that explicitly states differently, happy to look into it, but for the time being, we’re following the north star Apple’s laid out here. Just because HomeKit will accept a character, in general, Apple sets these guidelines up for a reason…sometimes with clear reasons, often times not, but over time the reasons for those guidelines typically become clear. Appreciate you highlighting that we have examples that need to be updated and we’ll do so. |
I actually disagree that what I highlight a not valid names. While HomeKit accepts those characters in names (as it does so far in iOS 17 and iOS 18) Hapnodejs should still allow those characters. If we're going to be "stubborn" on this, then at least provide a mechanism for the accessory developer to disable this warning |
We have no plans to do so. What you refer to as “valid names” are explicitly not valid. Just because HomeKit may accept them currently doesn’t make them valid. You’re always welcome to use earlier versions of HAP-NodeJS if you prefer, but our goal is to be compliant with Apple conventions and guidelines, not merely what HomeKit will or won’t accept in a given version of the ecosystem. |
This PR: