Naming convention question


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">
		<label>Current Album Cover Art</label>
		<description>Cover art of the album currently playing</description>
		<state readOnly="true"/>

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

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

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

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


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.