Closed thewilli closed 5 years ago
Ok so you want to have Bathroom_Light instead of BathroomLight?
I have not seen any documentation yet, that says how to case item names. if you look at the grammar everything from Camel Case to lower case to snake case to whatever case is possible. You can even start with digits if you want: https://github.com/eclipse/smarthome/blob/7176f8961a4caba501fe38bab52a44c8705011c3/bundles/model/org.eclipse.smarthome.model.item/src/org/eclipse/smarthome/model/Items.xtext#L67
terminal ID : '^'?('a'..'z'|'A'..'Z'|'_'|'0'..'9') ('a'..'z'|'A'..'Z'|'_'|'-'|'0'..'9')*;
there are no restrictions on how to write the item names. i dont think that anyone is confused by case conventions here.
I guess all the other docs are more or less just copy&paste of the original docs.
here for example is a binding that just uses lower case: https://www.openhab.org/addons/bindings/anel1/#item-configuration
Same here: https://www.openhab.org/addons/bindings/asterisk1/
here it is even mixed: https://www.openhab.org/addons/bindings/astro/
Its a bit extreme to say everyone does it like that.
However i would accept that some people want to define a way how items and names of generated parts are generated. So what i would propose is to add a config where you can set naming convention you want to use. however as this is in my opinion quite low prio at least i would not start with this for a while. However feel free to open a PR or give ideas on how to achieve an ideal solution for this.
However feel free to open a PR or give ideas on how to achieve an ideal solution for this.
@SamuelBrucksch
This extension allows for creating
Item
definitions including bindings fromThings
.Expected Behavior
If I look at the Item documentation, all
Item
names are spelled using Upper Snake Case. The documentation for all of the officialBindings
that I've checked behaves the same - and so do the many tutorials found online.Guest Bathroom Switch
=>Guest_Bathroom_Switch
Current Behavior
In order to generate a new name for an Item, the
classify()
function of the underscore.string library is used internally. The result is a Pascal Case conversion of theThing
name.Guest Bathroom Switch
=>GuestBathroomSwitch
Possible Solution
the first which comes into my mind would be something like
Steps to Reproduce (for Bugs)
.items
fileThing
from the list and selectCreate Items from Channels
Context
I think that the current behavior:
Item
base who want to stick to their naming conventionYour Environment