-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[unifiedremote] Initial contribution (#8546)
Signed-off-by: GiviMAD <miguelwork92@gmail.com>
- Loading branch information
Showing
15 changed files
with
936 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# UnifiedRemote Binding | ||
|
||
This binding integrates the [Unified Remote Server](https://www.unifiedremote.com/). | ||
|
||
<b>Known Limitations: It needs the web interface to be enabled on the server settings to work.</b> | ||
|
||
## Discovery | ||
|
||
Discovery works on the default discovery UDP port 9511. | ||
|
||
## Thing Configuration | ||
|
||
Only supported thing is 'Unified Remote Server Thing' which requires the Hostname to be correctly configured in order to work. | ||
|
||
| ThinTypeID | description | | ||
|----------|------------------------------| | ||
| server | Unified Remote Server Thing | | ||
|
||
|
||
| Config | Type | description | | ||
|----------|----------|------------------------------| | ||
| host | String | Unified Remote Server IP | | ||
|
||
|
||
|
||
## Channels | ||
|
||
|
||
| channel | type | description | | ||
|----------|--------|------------------------------| | ||
| mouse-move | String | Relative mouse move in pixels. Expect number JSON array [x,y] ("[10,10]"). | | ||
| send-key | String | Use server key. Supported keys are: LEFT_CLICK, RIGHT_CLICK, LOCK, UNLOCK, SLEEP, SHUTDOWN, RESTART, LOGOFF, PLAY, PLAY, PAUSE, NEXT, PREVIOUS, STOP, VOLUME_MUTE, VOLUME_UP, VOLUME_DOWN, BRIGHTNESS_UP, BRIGHTNESS_DOWN, MONITOR_OFF, MONITOR_ON, ESCAPE, SPACE, BACK, LWIN, CONTROL, TAB, MENU, RETURN, UP, DOWN, LEFT, RIGHT | | ||
|
||
|
||
## Full Example | ||
|
||
### Sample Thing | ||
|
||
``` | ||
Thing unifiedremote:server:xx-xx-xx-xx-xx-xx [ host="192.168.1.10" ] | ||
``` | ||
|
||
### Sample Items | ||
|
||
``` | ||
Group pcRemote "Living room PC" | ||
String PC_SendKey "Send Key" (pcRemote) { channel="unifiedremote:server:xx-xx-xx-xx-xx-xx:send-key" } | ||
String PC_MouseMove "Mouse Move" (pcRemote) { channel="samsungtv:tv:livingroom:mouse-move" } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | ||
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>3.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.openhab.binding.unifiedremote</artifactId> | ||
|
||
<name>openHAB Add-ons :: Bundles :: UnifiedRemote Binding</name> | ||
|
||
</project> |
23 changes: 23 additions & 0 deletions
23
bundles/org.openhab.binding.unifiedremote/src/main/feature/feature.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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 | ||
--> | ||
<features name="org.openhab.binding.unifiedremote-${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-unifiedremote" description="UnifiedRemote Binding" version="${project.version}"> | ||
<feature>openhab-runtime-base</feature> | ||
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.unifiedremote/${project.version}</bundle> | ||
</feature> | ||
</features> |
46 changes: 46 additions & 0 deletions
46
...c/main/java/org/openhab/binding/unifiedremote/internal/UnifiedRemoteBindingConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* 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.unifiedremote.internal; | ||
|
||
import java.util.Collections; | ||
import java.util.Set; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.openhab.core.thing.ThingTypeUID; | ||
|
||
/** | ||
* The {@link UnifiedRemoteBindingConstants} class defines common constants, which are | ||
* used across the whole binding. | ||
* | ||
* @author Miguel Álvarez - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class UnifiedRemoteBindingConstants { | ||
|
||
private static final String BINDING_ID = "unifiedremote"; | ||
|
||
// List of all Thing Type UIDs | ||
public static final ThingTypeUID THING_TYPE_UNIFIED_REMOTE_SERVER = new ThingTypeUID(BINDING_ID, "server"); | ||
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections | ||
.singleton(THING_TYPE_UNIFIED_REMOTE_SERVER); | ||
|
||
// List of all Channel ids | ||
public static final String MOUSE_CHANNEL = "mouse-move"; | ||
public static final String SEND_KEY_CHANNEL = "send-key"; | ||
|
||
// List of all Parameters | ||
public static final String PARAMETER_MAC_ADDRESS = "macAddress"; | ||
public static final String PARAMETER_HOSTNAME = "host"; | ||
public static final String PARAMETER_TCP_PORT = "udpPort"; | ||
public static final String PARAMETER_UDP_PORT = "tcpPort"; | ||
} |
27 changes: 27 additions & 0 deletions
27
.../src/main/java/org/openhab/binding/unifiedremote/internal/UnifiedRemoteConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* 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.unifiedremote.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* The {@link UnifiedRemoteConfiguration} class contains fields mapping thing configuration parameters. | ||
* | ||
* @author Miguel Álvarez - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class UnifiedRemoteConfiguration { | ||
public String host = ""; | ||
public int tcpPort; | ||
public int udpPort; | ||
} |
Oops, something went wrong.