openhab / openhab-vscode

VS Code extension for openHAB configuration files
https://marketplace.visualstudio.com/items?itemName=openhab.openhab
Eclipse Public License 2.0
159 stars 47 forks source link

[RFC]Refactor item from channel creation #251

Open Confectrician opened 3 years ago

Confectrician commented 3 years ago

Is your feature request related to a problem? Please describe. Not a real problem/bug but some user feedback.

Describe the solution you'd like A proper logic to generate item labels from channel names that have no dedicated label.

Describe alternatives you've considered Leave as is for now.

Additional context Reference of the Community Thread

herrep commented 3 years ago

Current behavior: The item label is always created from the channel name. The underscores in the channel name (snake style) are replaced by spaces and the text is converted to lower case except for the first word.

Suggested behavior: Check first whether there is a channel label available. In this case, populate the item label with the contents of the channel label, without any modifications. Proceed with the present behavior of deriving the item label from the channel name, if there is no channel label available.

Optional feature: Implement a switch whether the item label derived from the channel name needs to be converted to lower case.