Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kaleidescape] Kaleidescape Movie Player Binding - initial contribution #7568

Merged
merged 48 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
29400b5
Merge pull request #1 from openhab/2.5.x
mlobstein Apr 13, 2020
37d791e
Merge pull request #2 from openhab/2.5.x
mlobstein Apr 19, 2020
0f0e2ba
Kaleidescape Binding - initial contribution
mlobstein May 7, 2020
36dfe97
Cleanup before review
mlobstein May 22, 2020
7f6e1ec
update pom version to 2.5.6
mlobstein May 23, 2020
1184774
Start removing org.apache.commons.lang dependencies
mlobstein May 26, 2020
82462cd
Merge pull request #3 from openhab/2.5.x
mlobstein May 27, 2020
ecf44b9
Merge branch '2.5.x' into Kaleidescape
mlobstein May 27, 2020
3df7715
pmd and spotless cleanup
mlobstein May 27, 2020
89fedef
Http client and Label cleanup
mlobstein May 27, 2020
9fbfa46
pre-review changes
mlobstein Jun 1, 2020
76d5c5b
Add ThingAction
mlobstein Jun 1, 2020
5d548cc
Merge pull request #4 from openhab/2.5.x
mlobstein Jun 4, 2020
7be08b1
implement review changes from other PR
mlobstein Jun 10, 2020
781abb0
more review changes
mlobstein Jun 15, 2020
41709ef
Merge pull request #5 from openhab/2.5.x
mlobstein Jun 24, 2020
90b374d
Merge branch '2.5.x' into Kaleidescape
mlobstein Jun 24, 2020
5e9bb0c
review changes from other pr
mlobstein Jun 24, 2020
8d23120
improvements and review changes
mlobstein Jun 25, 2020
6cd55e7
remove InterruptedIOException
mlobstein Jun 26, 2020
45bf4f6
review changes
mlobstein Jul 7, 2020
5b2bbda
review changes
mlobstein Jul 7, 2020
c08523a
minor formatting changes
mlobstein Jul 8, 2020
9c3a175
Add ThingActions bug workaround
mlobstein Jul 16, 2020
b3285d6
Merge pull request #6 from openhab/2.5.x
mlobstein Jul 16, 2020
bb53296
[kaleidescape] Workaround for thing actions bug
mlobstein Jul 17, 2020
9b57919
Merge pull request #7 from openhab/2.5.x
mlobstein Jul 25, 2020
78f6977
Merge pull request #8 from openhab/2.5.x
mlobstein Jul 28, 2020
fe2e96a
Merge branch '2.5.x' into Kaleidescape
mlobstein Jul 29, 2020
5380985
update version and review changes
mlobstein Jul 29, 2020
ede36af
removed unused dependencies
mlobstein Aug 14, 2020
4606089
more review changes
mlobstein Aug 14, 2020
f49106b
Merge pull request #9 from openhab/2.5.x
mlobstein Aug 22, 2020
5fd1b3d
Roll forward a few review changes
mlobstein Aug 25, 2020
94e4815
fix thread naming convention
mlobstein Aug 26, 2020
ce6b1b8
Merge branch '2.5.x' of https://github.com/openhab/openhab-addons int…
mlobstein Aug 26, 2020
bf93c06
Merge branch '2.5.x' into Kaleidescape
mlobstein Aug 26, 2020
ad93130
fix thread naming convention
mlobstein Aug 26, 2020
31227c5
Merge branch '2.5.x' of https://github.com/openhab/openhab-addons int…
mlobstein Aug 26, 2020
91b502d
Merge branch '2.5.x' into Kaleidescape
mlobstein Aug 26, 2020
86a5327
Merge remote-tracking branch 'upstream/2.5.x' into 2.5.x
mlobstein Sep 3, 2020
a649668
Merge remote-tracking branch 'upstream/2.5.x' into 2.5.x
mlobstein Sep 3, 2020
61abc1f
Merge branch '2.5.x' into Kaleidescape
mlobstein Sep 3, 2020
05fbbaf
Merge remote-tracking branch 'upstream/2.5.x' into 2.5.x
mlobstein Sep 9, 2020
a45901a
Merge remote-tracking branch 'upstream/2.5.x' into 2.5.x
mlobstein Sep 9, 2020
803c0bb
Merge branch '2.5.x' into Kaleidescape
mlobstein Sep 9, 2020
da75f58
more review changes
mlobstein Sep 11, 2020
e1d9985
implement thing per model and caching
mlobstein Sep 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
/bundles/org.openhab.binding.ipp/ @peuter
/bundles/org.openhab.binding.irtrans/ @kgoderis
/bundles/org.openhab.binding.jeelink/ @vbier
/bundles/org.openhab.binding.kaleidescape/ @mlobstein
/bundles/org.openhab.binding.keba/ @kgoderis
/bundles/org.openhab.binding.km200/ @Markinus
/bundles/org.openhab.binding.knx/ @sjka
Expand Down
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@
<artifactId>org.openhab.binding.jeelink</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.kaleidescape</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.keba</artifactId>
Expand Down
32 changes: 32 additions & 0 deletions bundles/org.openhab.binding.kaleidescape/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
23 changes: 23 additions & 0 deletions bundles/org.openhab.binding.kaleidescape/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.openhab.binding.kaleidescape</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.kaleidescape/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This content is produced and maintained by the openHAB project.

* Project home: https://www.openhab.org

== Declared Project Licenses

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/.

== Source Code

https://github.com/openhab/openhab-addons
437 changes: 437 additions & 0 deletions bundles/org.openhab.binding.kaleidescape/README.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions bundles/org.openhab.binding.kaleidescape/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.7-SNAPSHOT</version>
</parent>

cpmeister marked this conversation as resolved.
Show resolved Hide resolved
<artifactId>org.openhab.binding.kaleidescape</artifactId>

<name>openHAB Add-ons :: Bundles :: Kaleidescape Binding</name>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.kaleidescape-${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-kaleidescape" description="Kaleidescape Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<feature>openhab-transport-serial</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.kaleidescape/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.kaleidescape.internal;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.smarthome.core.thing.ThingTypeUID;

/**
* The {@link KaleidescapeBindingConstants} class defines common constants, which are
* used across the whole binding.
*
* @author Michael Lobstein - Initial contribution
*/
@NonNullByDefault
public class KaleidescapeBindingConstants {
public static final String BINDING_ID = "kaleidescape";

// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_PLAYER_ZONE = new ThingTypeUID(BINDING_ID, "player");

public static final int DEFAULT_API_PORT = 10000;
public static final short DISCOVERY_SUBNET_MASK = 24;
public static final int DISCOVERY_THREAD_POOL_SIZE = 15;
public static final boolean DISCOVERY_DEFAULT_AUTO_DISCOVER = false;
public static final int DISCOVERY_DEFAULT_TIMEOUT_RATE = 500;
public static final int DISCOVERY_DEFAULT_IP_TIMEOUT_RATE = 750;
mlobstein marked this conversation as resolved.
Show resolved Hide resolved

// Component Types
public static final String PLAYER = "Player";
public static final String CINEMA_ONE = "Cinema One";
public static final String ALTO = "Alto";
public static final String STRATO = "Strato";
public static final String STRATO_S = "Strato S";
public static final String DISC_VAULT = "Disc Vault";

public static final Set<String> ALLOWED_DEVICES = new HashSet<String>(
Arrays.asList(PLAYER, CINEMA_ONE, ALTO, STRATO, STRATO_S, DISC_VAULT));

// List of all Channels
public static final String POWER = "ui#power";
public static final String VOLUME = "ui#volume";
public static final String MUTE = "ui#mute";
public static final String CONTROL = "ui#control";
public static final String TITLE_NAME = "ui#title_name";
public static final String PLAY_MODE = "ui#play_mode";
public static final String PLAY_SPEED = "ui#play_speed";
public static final String TITLE_NUM = "ui#title_num";
public static final String TITLE_LENGTH = "ui#title_length";
public static final String TITLE_LOC = "ui#title_loc";
public static final String CHAPTER_NUM = "ui#chapter_num";
public static final String CHAPTER_LENGTH = "ui#chapter_length";
public static final String CHAPTER_LOC = "ui#chapter_loc";
public static final String MOVIE_MEDIA_TYPE = "ui#movie_media_type";
public static final String MOVIE_LOCATION = "ui#movie_location";
public static final String ASPECT_RATIO = "ui#aspect_ratio";
public static final String VIDEO_MODE = "ui#video_mode";
public static final String VIDEO_MODE_COMPOSITE = "ui#video_mode_composite";
public static final String VIDEO_MODE_COMPONENT = "ui#video_mode_component";
public static final String VIDEO_MODE_HDMI = "ui#video_mode_hdmi";
public static final String VIDEO_COLOR = "ui#video_color";
public static final String VIDEO_COLOR_EOTF = "ui#video_color_eotf";
public static final String CONTENT_COLOR = "ui#content_color";
public static final String CONTENT_COLOR_EOTF = "ui#content_color_eotf";
public static final String SCALE_MODE = "ui#scale_mode";
public static final String SCREEN_MASK = "ui#screen_mask";
public static final String SCREEN_MASK2 = "ui#screen_mask2";
public static final String CINEMASCAPE_MASK = "ui#cinemascape_mask";
public static final String CINEMASCAPE_MODE = "ui#cinemascape_mode";
public static final String UI_STATE = "ui#ui_state";
public static final String CHILD_MODE_STATE = "ui#child_mode_state";
public static final String SYSTEM_READINESS_STATE = "ui#readiness_state";
public static final String HIGHLIGHTED_SELECTION = "ui#highlighted_selection";
public static final String USER_DEFINED_EVENT = "ui#user_defined_event";
public static final String USER_INPUT = "ui#user_input";
public static final String USER_INPUT_PROMPT = "ui#user_input_prompt";

public static final String MUSIC = "music#";
public static final String MUSIC_CONTROL = "music#control";
public static final String MUSIC_REPEAT = "music#repeat";
public static final String MUSIC_RANDOM = "music#random";
public static final String MUSIC_TRACK = "music#track";
public static final String MUSIC_ARTIST = "music#artist";
public static final String MUSIC_ALBUM = "music#album";
public static final String MUSIC_PLAY_MODE = "music#play_mode";
public static final String MUSIC_PLAY_SPEED = "music#play_speed";
public static final String MUSIC_TRACK_LENGTH = "music#track_length";
public static final String MUSIC_TRACK_POSITION = "music#track_position";
public static final String MUSIC_TRACK_PROGRESS = "music#track_progress";
public static final String MUSIC_TRACK_HANDLE = "music#track_handle";
public static final String MUSIC_ALBUM_HANDLE = "music#album_handle";
public static final String MUSIC_NOWPLAY_HANDLE = "music#nowplay_handle";

public static final String DETAIL = "detail#";

// metadata details - the values are keyed to what is sent by the component
// prefaced with 'detail_' when updating the channel
public static final String CONTENT_HANDLE = "content_handle";
public static final String ALBUM_CONTENT_HANDLE = "album_content_handle";
public static final String MOVIE = "movie";
public static final String ALBUM = "album";
public static final String DETAIL_TYPE = "type";
public static final String DETAIL_TITLE = "title"; // movie
public static final String DETAIL_ALBUM_TITLE = "album_title"; // album
public static final String DETAIL_COVER_ART = "cover_art"; // both
public static final String DETAIL_COVER_URL = "cover_url"; // both
public static final String DETAIL_HIRES_COVER_URL = "hires_cover_url"; // both
public static final String DETAIL_RATING = "rating"; // movie
public static final String DETAIL_YEAR = "year"; // both
public static final String DETAIL_RUNNING_TIME = "running_time"; // both
public static final String DETAIL_ACTORS = "actors"; // movie
public static final String DETAIL_ARTIST = "artist"; // album
public static final String DETAIL_DIRECTORS = "directors"; // movie
public static final String DETAIL_GENRES = "genres"; // both
public static final String DETAIL_RATING_REASON = "rating_reason"; // movie
public static final String DETAIL_SYNOPSIS = "synopsis"; // movie
public static final String DETAIL_REVIEW = "review"; // album
public static final String DETAIL_COLOR_DESCRIPTION = "color_description"; // movie
public static final String DETAIL_COUNTRY = "country"; // movie
public static final String DETAIL_ASPECT_RATIO = "aspect_ratio"; // movie
public static final String DETAIL_DISC_LOCATION = "disc_location"; // both

// make a list of all allowed metatdata channels,
// used to filter out what we don't want from the component
public static final Set<String> METADATA_CHANNELS = new HashSet<String>(
Arrays.asList(DETAIL_TITLE, DETAIL_ALBUM_TITLE, DETAIL_COVER_URL, DETAIL_HIRES_COVER_URL, DETAIL_RATING,
DETAIL_YEAR, DETAIL_RUNNING_TIME, DETAIL_ACTORS, DETAIL_ARTIST, DETAIL_DIRECTORS, DETAIL_GENRES,
DETAIL_RATING_REASON, DETAIL_SYNOPSIS, DETAIL_REVIEW, DETAIL_COLOR_DESCRIPTION, DETAIL_COUNTRY,
DETAIL_ASPECT_RATIO, DETAIL_DISC_LOCATION));

public static final String STANDBY_MSG = "Device is in standby";
public static final String PROPERTY_COMPONENT_TYPE = "Component Type";
public static final String PROPERTY_FRIENDLY_NAME = "Friendly Name";
public static final String PROPERTY_SERIAL_NUMBER = "Serial Number";
public static final String PROPERTY_CONTROL_PROTOCOL_ID = "Control Protocol ID";
public static final String PROPERTY_SYSTEM_VERSION = "System Version";
public static final String PROPERTY_PROTOCOL_VERSION = "Protocol Version";

public static final String GET_DEVICE_TYPE_NAME = "GET_DEVICE_TYPE_NAME";
public static final String GET_FRIENDLY_NAME = "GET_FRIENDLY_NAME";
public static final String GET_DEVICE_INFO = "GET_DEVICE_INFO";
public static final String GET_SYSTEM_VERSION = "GET_SYSTEM_VERSION";
public static final String GET_DEVICE_POWER_STATE = "GET_DEVICE_POWER_STATE";
public static final String GET_CINEMASCAPE_MASK = "GET_CINEMASCAPE_MASK";
public static final String GET_CINEMASCAPE_MODE = "GET_CINEMASCAPE_MODE";
public static final String GET_SCALE_MODE = "GET_SCALE_MODE";
public static final String GET_SCREEN_MASK = "GET_SCREEN_MASK";
public static final String GET_SCREEN_MASK2 = "GET_SCREEN_MASK2";
public static final String GET_VIDEO_MODE = "GET_VIDEO_MODE";
public static final String GET_UI_STATE = "GET_UI_STATE";
public static final String GET_HIGHLIGHTED_SELECTION = "GET_HIGHLIGHTED_SELECTION";
public static final String GET_CHILD_MODE_STATE = "GET_CHILD_MODE_STATE";
public static final String GET_MOVIE_LOCATION = "GET_MOVIE_LOCATION";
public static final String GET_MOVIE_MEDIA_TYPE = "GET_MOVIE_MEDIA_TYPE";
public static final String GET_PLAYING_TITLE_NAME = "GET_PLAYING_TITLE_NAME";
public static final String GET_PLAY_STATUS = "GET_PLAY_STATUS";
public static final String GET_MUSIC_NOW_PLAYING_STATUS = "GET_MUSIC_NOW_PLAYING_STATUS";
public static final String GET_MUSIC_PLAY_STATUS = "GET_MUSIC_PLAY_STATUS";
public static final String GET_MUSIC_TITLE = "GET_MUSIC_TITLE";
public static final String GET_SYSTEM_READINESS_STATE = "GET_SYSTEM_READINESS_STATE";
public static final String GET_VIDEO_COLOR = "GET_VIDEO_COLOR";
public static final String GET_CONTENT_COLOR = "GET_CONTENT_COLOR";
public static final String SET_STATUS_CUE_PERIOD_1 = "SET_STATUS_CUE_PERIOD:1";

public static final String LEAVE_STANDBY = "LEAVE_STANDBY";
public static final String ENTER_STANDBY = "ENTER_STANDBY";

public static final String PLAY = "PLAY";
public static final String PAUSE = "PAUSE";
public static final String NEXT = "NEXT";
public static final String PREVIOUS = "PREVIOUS";
public static final String SCAN_FORWARD = "SCAN_FORWARD";
public static final String SCAN_REVERSE = "SCAN_REVERSE";

public static final String MUSIC_REPEAT_ON = "MUSIC_REPEAT_ON";
public static final String MUSIC_REPEAT_OFF = "MUSIC_REPEAT_OFF";
public static final String MUSIC_RANDOM_ON = "MUSIC_RANDOM_ON";
public static final String MUSIC_RANDOM_OFF = "MUSIC_RANDOM_OFF";

public static final String SEND_EVENT_VOLUME_CAPABILITIES_15 = "SEND_EVENT:VOLUME_CAPABILITIES=15";
public static final String SEND_EVENT_VOLUME_LEVEL_EQ = "SEND_EVENT:VOLUME_LEVEL=";
public static final String SEND_EVENT_MUTE = "SEND_EVENT:MUTE_";
public static final String MUTE_ON = "ON_FB";
public static final String MUTE_OFF = "OFF_FB";

public static final String ONE = "1";
public static final String ZERO = "0";
public static final String EMPTY = "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.kaleidescape.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link KaleidescapeException} class is used for any exception thrown by the binding
*
* @author Michael Lobstein - Initial contribution
*/
@NonNullByDefault
public class KaleidescapeException extends Exception {
private static final long serialVersionUID = 1L;

public KaleidescapeException() {
}

public KaleidescapeException(String message, Throwable t) {
super(message, t);
}

public KaleidescapeException(String message) {
super(message);
}
}
Loading