openhab/openhab — pull request #888 by petrklus (2014-02-25 17:20:30+00:00)
Title: MPD binding improvements

Adds support for track names, artist names and ability to read and set volume.

Example items:

```
Switch Mpd_Bathroom_StartStop "Start/Stop" (Bathroom) { mpd="ON:bad:play, OFF:bad:stop" }
Switch Mpd_Bathroom_NextPrev "Track control" (Bathroom) { mpd="ON:bad:next, OFF:bad:prev" }
Dimmer Mpd_Bathroom_VolumeControl "Volume [%d%%]" (Bathroom) { mpd="INCREASE:bad:volume_increase, DECREASE:bad:volume_decrease, PERCENT:bad:volume" }
```

Sample rules (to concatenate artist and title):

```
rule "concat"
when
Item CurrentTrack received update or
Item CurrentTrackTest received update
the
ConcatenatedItem.postUpdate(CurrentTrack.state.toString + " / " + CurrentTrackTest.state.toString)
end
```

Example sitemap:

```
Text item=Date
Text item=CurrentTrack
Text item=CurrentTrackTest
Text item=ConcatenatedItem
Switch item=Mpd_Bathroom_StartStop mappings=[OFF="Pause", ON="Play"]
Switch item=Mpd_Bathroom_NextPrev mappings=[OFF="Previous", ON="Next"]
Slider item=Mpd_Bathroom_VolumeControl
```