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

MQTT Settings hostname validation error is unclear regarding what is incorrect in the input #567

Open
3 tasks done
dekimsey opened this issue Nov 4, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@dekimsey
Copy link

dekimsey commented Nov 4, 2023

Perform all steps below and tick them with [x]

  • Check the related part of the Documentation
  • Update openHASP to the latest version
  • Reproduce the issue and describe all steps

Describe the bug

I am unable to set a valid hostname on the MQTT Settings page.
I am using 0.7.0-rc6.

To Reproduce

  1. Navigate to MQTT Settings (/config/mqtt)
  2. Attempt to define an hostname such as "plate-0"
  3. Error appears, "Please match the requested format"

Expected behavior

I'd like to ask a more descriptive message in the pop-up error message and document the character limitations in the docs that way it's more obvious to users what is not correct.

(It took me an embarrassingly long while to figure out what was wrong)

Anyway, thank you for the great project!

Screenshots or video

I dug around and found the pattern="[a-z0-9_]*" being set here.

@dekimsey dekimsey added the bug Something isn't working label Nov 4, 2023
@dekimsey dekimsey changed the title MQTT Settings hostname validation permits invalid underscores but prevents valid hyphen character MQTT Settings hostname validation error is unclear regarding what is incorrect in the input Nov 4, 2023
@dekimsey
Copy link
Author

dekimsey commented Nov 4, 2023

I originally requested to be able to add normal RFC hostnames (permitting hyphens, possibly disallowing underscores). But after I got further along I realized the issue is that this hostname is sort of an entity ID in homeassistant and - isn't valid there! I've edited this request to reflect that.

Though I do wish I could use normal hostnames and just have invalid characters converted to an underscore for an entity id. I understand that may not be appropriate. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant