forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial Russound Implementation (openhab#1225)
Signed-off-by: Tim Roberts <troberts@bigfoot.com>
- Loading branch information
Showing
41 changed files
with
6,441 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,7 @@ | ||
<?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="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.binding.russound</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> |
11 changes: 11 additions & 0 deletions
11
addons/binding/org.openhab.binding.russound/ESH-INF/binding/binding.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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<binding:binding id="russound" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" | ||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> | ||
|
||
<name>Russound Binding</name> | ||
<description>This is the binding for Russound.</description> | ||
<author>Tim Roberts</author> | ||
|
||
</binding:binding> |
11 changes: 11 additions & 0 deletions
11
addons/binding/org.openhab.binding.russound/ESH-INF/i18n/russound_xx_XX.properties
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,11 @@ | ||
# binding | ||
binding.russound.name = <Your localized Binding name> | ||
binding.russound.description = <Your localized Binding description> | ||
|
||
# thing types | ||
thing-type.russound.sample.label = <Your localized Thing label> | ||
thing-type.russound.sample.description = <Your localized Thing description> | ||
|
||
# channel types | ||
channel-type.russound.sample-channel.label = <Your localized Channel label> | ||
channel-type.russound.sample-channel.description = <Your localized Channel description> |
324 changes: 324 additions & 0 deletions
324
addons/binding/org.openhab.binding.russound/ESH-INF/thing/thing-types.xml
Large diffs are not rendered by default.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
addons/binding/org.openhab.binding.russound/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,27 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Russound Binding | ||
Bundle-SymbolicName: org.openhab.binding.russound;singleton:=true | ||
Bundle-Vendor: openHAB | ||
Bundle-Version: 2.0.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 | ||
Bundle-ClassPath: . | ||
Import-Package: | ||
com.google.common.collect, | ||
org.apache.commons.lang, | ||
org.eclipse.jetty.client, | ||
org.eclipse.jetty.client.api, | ||
org.eclipse.jetty.util.component, | ||
org.eclipse.smarthome.config.core, | ||
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.openhab.binding.russound, | ||
org.openhab.binding.russound.rio, | ||
org.slf4j | ||
Service-Component: OSGI-INF/*.xml | ||
Export-Package: org.openhab.binding.russound, | ||
org.openhab.binding.russound.rio |
20 changes: 20 additions & 0 deletions
20
addons/binding/org.openhab.binding.russound/OSGI-INF/RussoundHandlerFactory.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,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2014-2016 by the respective copyright holders. | ||
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" immediate="true" name="binding.russound"> | ||
|
||
<implementation class="org.openhab.binding.russound.internal.RussoundHandlerFactory"/> | ||
|
||
<service> | ||
<provide interface="org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory"/> | ||
</service> | ||
|
||
</scr:component> |
Large diffs are not rendered by default.
Oops, something went wrong.
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,6 @@ | ||
source.. = src/main/java/ | ||
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,19 @@ | ||
<?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"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.openhab.binding</groupId> | ||
<artifactId>pom</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<groupId>org.openhab.binding</groupId> | ||
<artifactId>org.openhab.binding.russound</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
|
||
<name>Russound Binding</name> | ||
<packaging>eclipse-plugin</packaging> | ||
|
||
</project> |
20 changes: 20 additions & 0 deletions
20
...binding.russound/src/main/java/org/openhab/binding/russound/RussoundBindingConstants.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,20 @@ | ||
/** | ||
* Copyright (c) 2014-2016 by the respective copyright holders. | ||
* | ||
* 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 | ||
*/ | ||
package org.openhab.binding.russound; | ||
|
||
/** | ||
* The {@link RussoundBinding} class defines common constants, which are | ||
* used across the whole binding. | ||
* | ||
* @author Tim Roberts - Initial contribution | ||
*/ | ||
public class RussoundBindingConstants { | ||
|
||
public static final String BINDING_ID = "russound"; | ||
} |
74 changes: 74 additions & 0 deletions
74
....russound/src/main/java/org/openhab/binding/russound/internal/RussoundHandlerFactory.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,74 @@ | ||
/** | ||
* Copyright (c) 2014-2016 by the respective copyright holders. | ||
* | ||
* 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 | ||
*/ | ||
package org.openhab.binding.russound.internal; | ||
|
||
import java.util.Set; | ||
|
||
import org.eclipse.smarthome.core.thing.Bridge; | ||
import org.eclipse.smarthome.core.thing.Thing; | ||
import org.eclipse.smarthome.core.thing.ThingTypeUID; | ||
import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; | ||
import org.eclipse.smarthome.core.thing.binding.ThingHandler; | ||
import org.openhab.binding.russound.rio.RioConstants; | ||
import org.openhab.binding.russound.rio.bank.RioBankHandler; | ||
import org.openhab.binding.russound.rio.controller.RioControllerHandler; | ||
import org.openhab.binding.russound.rio.favorites.RioFavoriteHandler; | ||
import org.openhab.binding.russound.rio.preset.RioPresetHandler; | ||
import org.openhab.binding.russound.rio.source.RioSourceHandler; | ||
import org.openhab.binding.russound.rio.system.RioSystemHandler; | ||
import org.openhab.binding.russound.rio.zone.RioZoneHandler; | ||
|
||
import com.google.common.collect.ImmutableSet; | ||
|
||
/** | ||
* The {@link RussoundHandlerFactory} is responsible for creating bridge and thing | ||
* handlers. | ||
* | ||
* @author Tim Roberts - Initial contribution | ||
*/ | ||
public class RussoundHandlerFactory extends BaseThingHandlerFactory { | ||
|
||
private final static Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = ImmutableSet.of(RioConstants.BRIDGE_TYPE_RIO, | ||
RioConstants.BRIDGE_TYPE_CONTROLLER, RioConstants.BRIDGE_TYPE_SOURCE, RioConstants.BRIDGE_TYPE_ZONE, | ||
RioConstants.BRIDGE_TYPE_BANK, RioConstants.THING_TYPE_BANK_PRESET, RioConstants.THING_TYPE_ZONE_PRESET, | ||
RioConstants.THING_TYPE_SYSTEM_FAVORITE, RioConstants.THING_TYPE_ZONE_FAVORITE); | ||
|
||
@Override | ||
public boolean supportsThingType(ThingTypeUID thingTypeUID) { | ||
return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); | ||
} | ||
|
||
@Override | ||
protected ThingHandler createHandler(Thing thing) { | ||
|
||
ThingTypeUID thingTypeUID = thing.getThingTypeUID(); | ||
|
||
if (thingTypeUID.equals(RioConstants.BRIDGE_TYPE_RIO)) { | ||
return new RioSystemHandler((Bridge) thing); | ||
} else if (thingTypeUID.equals(RioConstants.BRIDGE_TYPE_CONTROLLER)) { | ||
return new RioControllerHandler((Bridge) thing); | ||
} else if (thingTypeUID.equals(RioConstants.BRIDGE_TYPE_SOURCE)) { | ||
return new RioSourceHandler((Bridge) thing); | ||
} else if (thingTypeUID.equals(RioConstants.BRIDGE_TYPE_ZONE)) { | ||
return new RioZoneHandler((Bridge) thing); | ||
} else if (thingTypeUID.equals(RioConstants.BRIDGE_TYPE_BANK)) { | ||
return new RioBankHandler((Bridge) thing); | ||
} else if (thingTypeUID.equals(RioConstants.THING_TYPE_BANK_PRESET)) { | ||
return new RioPresetHandler(thing); | ||
} else if (thingTypeUID.equals(RioConstants.THING_TYPE_ZONE_PRESET)) { | ||
return new RioPresetHandler(thing); | ||
} else if (thingTypeUID.equals(RioConstants.THING_TYPE_SYSTEM_FAVORITE)) { | ||
return new RioFavoriteHandler(thing); | ||
} else if (thingTypeUID.equals(RioConstants.THING_TYPE_ZONE_FAVORITE)) { | ||
return new RioFavoriteHandler(thing); | ||
} | ||
|
||
return null; | ||
} | ||
} |
Oops, something went wrong.