Skip to content

Generate a valid Home Assistant ID instead using the label 1:1 #2749

@thomasfrobieter

Description

@thomasfrobieter

When renaming devices in z2mqtt there is a checkbox to update the Home Assistant ID.
This is great, but it takes the label 1:1, with uppercase letters, spaces, etc.

The Home Assistant docs say "You can use lowercase letters, numbers, and underscores."

So while it works with the current solution (as far as I experienced it), it should better follow this convention.

Describe the solution you'd like
Drupal (CMS) has a very similar feature when naming content types oder fields. Its open source, so maybe you could more or less copy this over: https://git.drupalcode.org/project/drupal/-/blob/main/core/misc/machine-name.js?ref_type=heads

Image

when clicking edit:

Image

You can try it here: https://simplytest.me/ => One click demos => Drupal CMS
Login to the demo by adding "/user" to the URL. Default Login is admin/admin.
Go to: Structure -> Content Types -> Add content Type

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions