Naming convention question

Hello,

what is wrong in the naming convention?

<channel id="title" typeId="title"/>
			<channel id="artist" typeId="artist"/>
			<channel id="album" typeId="album"/>
			<channel id="volume" typeId="volume"/>
			<channel id="player" typeId="player"/>
			<channel id="track-type" typeId="track-type"/>
			<channel id="play-radio-stream" typeId="play-radio-stream"/>
			<channel id="playPlaylist" typeId="playPlaylist"/>
			<channel id="clearQueue" typeId="clearQueue"/>
			<channel id="playURI" typeId="playURI"/>
			<channel id="playFile" typeId="playFile"/>
			<channel id="random" typeId="playRandom"/>
			<channel id="repeat" typeId="playRepeat"/>
			<channel id="systemCommand" typeId="systemCommand"/>
			<channel id="stopCommand" typeId="stopCommand"/>

Thanks for the help

<channel id="trackType" typeId="trackType"/>
<channel id="playRadio-Stream" typeId="playRadioStream"/>
<channel id="playUri" typeId="playUri"/>

Please see Coding Guidelines | openHAB.

So, for example, playPlaylist would need to be renamed to play-playlist.

I have not read the guideline for a long time, so did not have them in mind when answering.
But if I rember correct, there are a lot of bindings using the same syntax like in my answer…

Example from the Sonos Binding :

	<channel-type id="currentalbumart">
		<item-type>Image</item-type>
		<label>Current Album Cover Art</label>
		<description>Cover art of the album currently playing</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="currentalbumarturl" advanced="true">
		<item-type>String</item-type>
		<label>Current Album Cover Art URL</label>
		<description>Cover art URL of the album currently playing</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="currenttrack" advanced="true">
		<item-type>String</item-type>
		<label>Current Track</label>
		<description>Name of the current track or radio station currently playing</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="currenttrackuri" advanced="true">
		<item-type>String</item-type>
		<label>Current Track URI</label>
		<description>URI of the current track</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="currenttransporturi" advanced="true">
		<item-type>String</item-type>
		<label>Current AV Transport URI</label>
		<description>URI of the current AV transport</description>
		<state readOnly="true"/>
	</channel-type>

Correct.

However, we now finally have an official naming convention going forward.

When adding new channels to existing bindings, it’s normally preferable to stay consistent with the existing convention used within that binding.

For new bindings the naming convention should be followed.

See also: Suggestion to establish an official naming convention · openhab/openhab-distro · Discussion #1504 · GitHub

1 Like

Ah bugger, so I’ll have to fix mine then.