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

[bug] The location field doesn't allow to use a space in the name #877

Closed
bogdanr opened this issue Mar 12, 2021 · 5 comments · Fixed by #897
Closed

[bug] The location field doesn't allow to use a space in the name #877

bogdanr opened this issue Mar 12, 2021 · 5 comments · Fixed by #897
Assignees
Labels
question Further information is requested

Comments

@bogdanr
Copy link

bogdanr commented Mar 12, 2021

Pretty much everywhere in HA I can use location fields with a space. And I have a bunch defined like this. But in the zwavejs2mqtt UI I can't do that so when I migrate it creates a bit of a mess.
b
Can we allow a space in the location and the name?

@bogdanr bogdanr added the bug Something isn't working label Mar 12, 2021
@robertsLando
Copy link
Member

@bogdanr Could you use underscores? The problem is that locations are then used on topics, even if spaces are allowed in topics I would prefer not have them...

@bogdanr
Copy link
Author

bogdanr commented Mar 13, 2021 via email

@dwradcliffe
Copy link

I agree, I had spaces in names and locations before (in ozwd and HA) and this is going to create a mess if we have 2 versions of the same name/location. Please allow spaces for both of these fields.

@robertsLando
Copy link
Member

Never use spaces in a topic
A space is the natural enemy of every programmer. When things are not going the way they should, spaces make it much harder to read and debug topics. As with leading forward slashes, just because something is allowed, doesn’t mean it should be used. UTF-8 has many different white space types, such uncommon characters should be avoided.

From: https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices/

I have no problem adding spaces on location, it's just not a good practise when it needs to be used with mqtt.

@robertsLando robertsLando added question Further information is requested and removed bug Something isn't working labels Mar 15, 2021
@dwradcliffe
Copy link

Perhaps a different compromise would be to allow spaces but then translate to underscores for MQTT topics? That doesn't completely solve this but at least fixes it for users that don't need MQTT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants