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

Initial Commit of the Hue Emulator Binding #654

Merged
merged 1 commit into from
Feb 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions addons/io/org.openhab.io.hueemulation/.classpath
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>
33 changes: 33 additions & 0 deletions addons/io/org.openhab.io.hueemulation/.project
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 addons/io/org.openhab.io.hueemulation/ESH-INF/config/config.xml
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 addons/io/org.openhab.io.hueemulation/META-INF/MANIFEST.MF
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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the version constraint

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please still remove the constraint :-)

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 addons/io/org.openhab.io.hueemulation/OSGI-INF/hueemulation.xml
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>
26 changes: 26 additions & 0 deletions addons/io/org.openhab.io.hueemulation/README.md
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"]
```
7 changes: 7 additions & 0 deletions addons/io/org.openhab.io.hueemulation/build.properties
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/
20 changes: 20 additions & 0 deletions addons/io/org.openhab.io.hueemulation/pom.xml
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>
Loading