-
-
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.
Merge pull request #654 from digitaldan/HueEmulator
Initial Commit of the Hue Emulator Binding
- Loading branch information
Showing
18 changed files
with
1,040 additions
and
0 deletions.
There are no files selected for viewing
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src/main/java"/> | ||
<classpathentry kind="src" path="src/main/resources"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
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,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.openhab.io.hueemulation</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ds.core.builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
17 changes: 17 additions & 0 deletions
17
addons/io/org.openhab.io.hueemulation/ESH-INF/config/config.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,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<config-description:config-descriptions | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:config-description="http://eclipse.org/smarthome/schemas/config-description/v1.0.0" | ||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/config-description/v1.0.0 | ||
http://eclipse.org/smarthome/schemas/config-description-1.0.0.xsd"> | ||
<config-description uri="io:hueemulation"> | ||
<parameter name="pairingEnabled" type="text" required="true"> | ||
<label>Enable Device Pairing</label> | ||
<description>Pairing must be enabled to connect a new device. Once a device has been added, pairing should be disabled.</description> | ||
<options> | ||
<option value="true">Pairing Enabled</option> | ||
<option value="false">Pairing Disabled</option> | ||
</options> | ||
</parameter> | ||
</config-description> | ||
</config-description:config-descriptions> |
29 changes: 29 additions & 0 deletions
29
addons/io/org.openhab.io.hueemulation/META-INF/MANIFEST.MF
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,29 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Hue Emulation Service | ||
Bundle-SymbolicName: org.openhab.io.hueemulation;singleton:=true | ||
Bundle-Vendor: openHAB | ||
Bundle-Version: 2.0.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 | ||
Bundle-ClassPath: . | ||
Import-Package: com.google.gson;version="2.2.4", | ||
javax.servlet, | ||
javax.servlet.http, | ||
org.apache.commons.io, | ||
org.eclipse.smarthome.config.core, | ||
org.eclipse.smarthome.core.events, | ||
org.eclipse.smarthome.core.items, | ||
org.eclipse.smarthome.core.items.events, | ||
org.eclipse.smarthome.core.library.types, | ||
org.eclipse.smarthome.core.thing, | ||
org.eclipse.smarthome.core.thing.binding, | ||
org.eclipse.smarthome.core.thing.binding.builder, | ||
org.eclipse.smarthome.core.thing.type, | ||
org.eclipse.smarthome.core.types, | ||
org.eclipse.smarthome.io.rest, | ||
org.osgi.framework, | ||
org.osgi.service.component, | ||
org.osgi.service.event, | ||
org.osgi.service.http, | ||
org.slf4j | ||
Service-Component: OSGI-INF/*.xml |
24 changes: 24 additions & 0 deletions
24
addons/io/org.openhab.io.hueemulation/OSGI-INF/hueemulation.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,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2014-2015 openHAB UG (haftungsbeschraenkt) and others. | ||
All rights reserved. This program and the accompanying materials | ||
are made available under the terms of the Eclipse Public License v1.0 | ||
which accompanies this distribution, and is available at | ||
http://www.eclipse.org/legal/epl-v10.html | ||
--> | ||
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" deactivate="deactivate" modified="modified" configuration-policy="optional" immediate="true" name="org.openhab.hueemulation"> | ||
<implementation class="org.openhab.io.hueemulation.internal.HueEmulationServlet"/> | ||
<reference bind="setHttpService" cardinality="1..1" interface="org.osgi.service.http.HttpService" name="HttpService" policy="static" unbind="unsetHttpService"/> | ||
<reference bind="setItemRegistry" cardinality="1..1" interface="org.eclipse.smarthome.core.items.ItemRegistry" name="ItemRegistry" policy="dynamic" unbind="unsetItemRegistry"/> | ||
<reference bind="setEventPublisher" cardinality="1..1" interface="org.eclipse.smarthome.core.events.EventPublisher" name="EventPublisher" policy="static" unbind="unsetEventPublisher"/> | ||
<property name="service.pid" type="String" value="org.openhab.hueemulation"/> | ||
<property name="service.config.description.uri" type="String" value="io:hueemulation"/> | ||
<property name="service.config.label" type="String" value="Hue Emulation"/> | ||
<property name="service.config.category" type="String" value="io"/> | ||
<service> | ||
<provide interface="javax.servlet.http.HttpServlet"/> | ||
</service> | ||
</scr:component> |
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,26 @@ | ||
|
||
|
||
#openHAB Hue Emulation Service | ||
|
||
Hue Emulation exposes openHAB items as Hue devices to other Hue HTTP API compatible applications like an Amazon Echo. | ||
|
||
##Features: | ||
* UPNP automatic discovery | ||
* Support ON/OFF and Percent/Decimal item types | ||
* Can expose any type of item, not just lights | ||
* Pairing (security) can be enabled/disabled in real time using the configuration service (under services in the PaperUI for example) | ||
|
||
##Configuration: | ||
Pairing can be turned on and off: | ||
|
||
``` | ||
org.openhab.hueemulation:pairingEnabled=false | ||
``` | ||
##Device Taging | ||
To expose an item on the service apply any Apple HomeKit style tag to it. The item label will be used as the Hue Device name. | ||
``` | ||
Switch TestSwitch1 "Kitchen Switch" ["homekit:Switch"] | ||
Switch TestSwitch2 "Bathroom" ["homekit:Lightbulb"] | ||
Dimmer TestDimmer3 "Hallway" ["homekit:DimmableLightbulb"] | ||
Number TestNumber4 "Cool Set Point" ["homekit:coolingThreshold"] | ||
``` |
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,7 @@ | ||
source.. = src/main/java/,\ | ||
src/main/resources/ | ||
output.. = target/classes | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/,\ | ||
ESH-INF/ |
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,20 @@ | ||
<?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/maven-v4_0_0.xsd"> | ||
|
||
<parent> | ||
<groupId>org.openhab.addons.io</groupId> | ||
<artifactId>pom</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.openhab.addons.io</groupId> | ||
<artifactId>org.openhab.io.hueemulation</artifactId> | ||
|
||
<name>Hue Emulation Service</name> | ||
|
||
<packaging>eclipse-plugin</packaging> | ||
|
||
</project> |
Oops, something went wrong.