Skip to content

Commit

Permalink
Merge branch 'ClementineRemote-3.3.0' into ClementineRemote
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
  • Loading branch information
Stephan Richter committed Jan 8, 2023
2 parents a7ed8e5 + 32a5718 commit d0f01b4
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 67 deletions.
10 changes: 10 additions & 0 deletions bundles/org.openhab.binding.clementineremote/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ This program and the accompanying materials are made available under the terms
of the Eclipse Public License 2.0 which is available at
https://www.eclipse.org/legal/epl-2.0/.

The included protobuf definition file emerged from the Clementine-Player Android-Remote project
and is licensed under the Apache License, Version 2.0.

The file src/main/java/de/qspool/clementineremote/backend/pb/ClementineRemote.java is generated from the
protocol buffers description files using Googles `protoc`.

Usage of protocol buffers within this project is limited to the inclusion of the com.google.protobuf library.

Protoc is *not* part of this project.

== Source Code

https://github.com/openhab/openhab-addons
39 changes: 21 additions & 18 deletions bundles/org.openhab.binding.clementineremote/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Clementine Remote Binding

<img style="float: right; margin: 0 0 5px 5px" src="doc/screenshot.png" alt="Screenshot" />
This binding shall bring the benefits of over-the-network control of the [Clementine-Player] to openHAB!
This binding brings the benefits of over-the-network control of the [Clementine-Player] to openHAB!

It allows control of playback, position and volume and allows display of various title information:

Expand All @@ -11,13 +11,15 @@ It allows control of playback, position and volume and allows display of various
* current position within track
* Album cover


[→ useful Links][links]

## Discovery

This thing does (currently) not provide auto-discovery.
This thing does not provide auto-discovery.
You will have to manually configure clementine to allow remote connections.

Detailed instructions how to configure Clementine's remote functions are provided here:

https://github.com/clementine-player/Android-Remote/wiki/How-to-use-the-Android-Remote

And you will have to manually configure the Thing instances to talk to your player:

## Thing Configuration
Expand All @@ -39,38 +41,39 @@ If you set a password in the Clementine configuration, you will have to provide

The binding provides the following channels:

| Channel | Type | Read/Write | Description |
|------------------|---------------|-------------|----------------------------------------------|
| album | String | read-only | Album the currently playing song belongs to |
| artist | String | read-only | Artist of the currently playing title |
| cover | Image | read-only | Cover of the current album |
| playback-control | String | read/write | Common control of playback and position |
| position | Number:Time | read-only | Current position within the playing track |
| state | String | read-only | Current state of Clementine player |
| title | String | read-only | Name of the currently playing track |
| track | String | read-only | Number of the title within the current album |
| volume-control | system.volume | read/write | Playback volume |
| Channel | Type | Read/Write | Description |
|------------------|-------------|-------------|----------------------------------------------|
| album | String | read-only | Album the currently playing song belongs to |
| artist | String | read-only | Artist of the currently playing title |
| cover | Image | read-only | Cover of the current album |
| playback-control | String | read/write | Common control of playback and position |
| position | Number:Time | read-only | Current position within the playing track |
| state | String | read-only | Current state of Clementine player |
| title | String | read-only | Name of the currently playing track |
| track | String | read-only | Number of the title within the current album |
| volume-control | Dommer | read/write | Playback volume |



## Full Example

### Thing

```
```yaml
UID: clementineremote:clementine:0590462b5b
label: Clementine
thingTypeUID: clementineremote:clementine
configuration:
port: 5500
hostname: 192.168.1.6
authCode: 123456
```
### Widget
based on https://community.openhab.org/t/universal-remote-widget/118423
```
```yaml
uid: clementine_remote
tags: []
props:
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.clementineremote/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<artifactId>org.openhab.binding.clementineremote</artifactId>

<name>openHAB Add-ons :: Bundles :: ClementineRemote Binding</name>
<name>openHAB Add-ons :: Bundles :: Clementine Remote Binding</name>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<features name="org.openhab.binding.clementineremote-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-binding-clementineremote" description="ClementineRemote Binding" version="${project.version}">
<feature name="openhab-binding-clementineremote" description="Clementine Remote Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.clementineremote/${project.version}</bundle>
</feature>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
* The {@link ClementineRemoteHandler} is responsible for handling commands, which are
* sent to one of the channels.
*
* It uses Clementine's own, protocol buffers based communication sheme:
* https://github.com/clementine-player/Android-Remote/wiki/Developer-Documentation
*
* @author Stephan Richter - Initial contribution
*/
@NonNullByDefault
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
# FIXME: please add all English translations to this file so the texts can be translated using Crowdin
# FIXME: to generate the content of this file run: mvn i18n:generate-default-translations
# FIXME: see also: https://www.openhab.org/docs/developer/utils/i18n.html
# binding

binding.clementineremote.name = Clementine Remote Control
binding.clementineremote.description = This is a binding to remotely control Clementine Player instances.

# thing types

thing-type.clementineremote.clementine.label = Clementine Remote
thing-type.clementineremote.clementine.description = Remote control binding for Clementine Player

# thing types config

thing-type.config.clementineremote.clementine.authCode.label = Auth Code
thing-type.config.clementineremote.clementine.authCode.description = Authentication code to access the Clementine player
thing-type.config.clementineremote.clementine.hostname.label = Hostname/IP
thing-type.config.clementineremote.clementine.hostname.description = Hostname or IP address of Clementine player
thing-type.config.clementineremote.clementine.port.label = Port
thing-type.config.clementineremote.clementine.port.description = Port to access the Clementine player

# channel types

channel-type.clementineremote.current-album.label = Current Album
channel-type.clementineremote.current-album.description = Album the currently playing title belongs to
channel-type.clementineremote.current-cover.label = Album Cover
channel-type.clementineremote.current-cover.description = Cover of the current album
channel-type.clementineremote.current-position.label = Current Position
channel-type.clementineremote.current-position.description = Current position within the playing track
channel-type.clementineremote.current-position.state.pattern = %1$tT
channel-type.clementineremote.current-state.label = Current State
channel-type.clementineremote.current-state.description = Current state of clementine player
channel-type.clementineremote.current-track.label = Current Track
channel-type.clementineremote.current-track.description = Number of the title within the current album
channel-type.clementineremote.playback-control.label = Playback Control
channel-type.clementineremote.playback-control.description = Common control of playback and position
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
# FIXME: please substitute the xx with a proper locale, ie. de
# FIXME: please do not add the file to the repo if you add or change no content
# binding

binding.clementineremote.name = Clementine-Fernsteuerung
binding.clementineremote.description = Fernsteuerung für den Clementine-Player

# thing types

thing-type.clementineremote.clementine.label = Clementine-Player
thing-type.clementineremote.clementine.description = integriert einen Clementine-Player ins OpenHAB
thing-type.clementineremote.clementine.description = integriert einen Clementine-Player ins openHAB

# thing type config description
thing-type.config.clementineremote.sample.hostname.label = Hostname/IP
thing-type.config.clementineremote.sample.hostname.description = Hostname oder IP-Adresse des Computers, auf dem Clementine läuft
thing-type.config.clementineremote.sample.password.label = Password
thing-type.config.clementineremote.sample.password.description = (Optionales) Passwort für die Fernsteuerung von Clementine
thing-type.config.clementineremote.sample.port.label = Port
thing-type.config.clementineremote.sample.port.description = Port, auf welchem Clementine Verbindungen annimmt. Standard: 5500
# thing types config

thing-type.config.clementineremote.clementine.authCode.label = Passwort
thing-type.config.clementineremote.clementine.authCode.description = Hostname oder IP-Adresse des Computers, auf dem Clementine läuft
thing-type.config.clementineremote.clementine.hostname.label = Hostname/IP
thing-type.config.clementineremote.clementine.hostname.description = Hostname oder IP-Adresse des Computers, auf dem Clementine läuft
thing-type.config.clementineremote.clementine.port.label = Port
thing-type.config.clementineremote.clementine.port.description = Port, auf welchem Clementine Verbindungen annimmt. Standard: 5500

# channel types
channel-type.clementineremote.playback-control.label = Wiedergabe-Steuerung
channel-type.clementineremote.playback-control.description = Zur Steuerung der Wiedergabe

channel-type.clementineremote.current-album.label = aktuelles Album
channel-type.clementineremote.current-album.description = Name des Albums, auf dem der gerade gespielte Titel ist
channel-type.clementineremote.current-artist.label = aktueller Interpret
channel-type.clementineremote.current-artist.description = Name des Interpreten des aktuell gespielten Titels
channel-type.clementineremote.current-cover.label = Cover-Bild
channel-type.clementineremote.current-cover.description = Cover-Bild des aktuell gespielten Titels
channel-type.clementineremote.current-position.label = Position
channel-type.clementineremote.current-position.description = Aktuelle Position der Wiedergabe im gespielten Titel
channel-type.clementineremote.current-title.label = aktueller Titel
channel-type.clementineremote.current-title.description = Name des aktuell gespielten Stücks
channel-type.clementineremote.current-track.label = aktuelle Titel-Nummer
channel-type.clementineremote.current-track.description = Nummer des gerade gespielten Titels innerhalb des Albums
channel-type.clementineremote.current-position.state.pattern = %1$tT
channel-type.clementineremote.current-state.label = Zustand
channel-type.clementineremote.current-state.description = Aktueller Zustand von Clementine (paused, playing, stopped, unknown)
channel-type.clementineremote.current-cover.label = Cover-Bild
channel-type.clementineremote.current-cover.description = Cover-Bild des aktuell gespielten Titels
channel-type.clementineremote.current-track.label = aktuelle Titel-Nummer
channel-type.clementineremote.current-track.description = Nummer des gerade gespielten Titels innerhalb des Albums
channel-type.clementineremote.playback-control.label = Wiedergabe-Steuerung
channel-type.clementineremote.playback-control.description = Zur Steuerung der Wiedergabe
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

<channels>
<channel id="album" typeId="current-album"/>
<channel id="artist" typeId="current-artist"/>
<channel id="artist" typeId="system.media-artist"/>
<channel id="playback-control" typeId="playback-control"/>
<channel id="position" typeId="current-position"/>
<channel id="state" typeId="current-state"/>
<channel id="title" typeId="current-title"/>
<channel id="title" typeId="system.media-title"/>
<channel id="track" typeId="current-track"/>
<channel id="volume-control" typeId="system.volume"/>
<channel id="cover" typeId="current-cover"/>
Expand All @@ -24,7 +24,7 @@
<config-description>
<parameter name="hostname" type="text" required="true">
<context>network-address</context>
<label>Hostname</label>
<label>Hostname/IP</label>
<description>Hostname or IP address of Clementine player</description>
</parameter>
<parameter name="authCode" type="integer" required="false">
Expand Down Expand Up @@ -54,27 +54,13 @@
<state readOnly="true"/>
</channel-type>

<channel-type id="current-artist">
<item-type>String</item-type>
<label>Current Artist</label>
<description>Artist of the currently playing title</description>
<state readOnly="true"/>
</channel-type>

<channel-type id="current-position">
<item-type>Number:Time</item-type>
<label>Current Position</label>
<description>Current position within the playing track</description>
<state readOnly="true" pattern="%1$tT"/>
</channel-type>

<channel-type id="current-title">
<item-type>String</item-type>
<label>Current Title</label>
<description>Name of the currently playing title</description>
<state readOnly="true"/>
</channel-type>

<channel-type id="current-track">
<item-type>String</item-type>
<label>Current Track</label>
Expand Down

0 comments on commit d0f01b4

Please sign in to comment.