forked from openhab/openhab1-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1 from openhab/master
Update from original
- Loading branch information
Showing
3,233 changed files
with
209,254 additions
and
29,793 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
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
27 changes: 27 additions & 0 deletions
27
bundles/action/org.openhab.action.homematic/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 | ||
Private-Package: org.openhab.action.homematic.internal | ||
Ignore-Package: org.openhab.action.homematic.internal | ||
Bundle-License: http://www.eclipse.org/legal/epl-v10.html | ||
Bundle-Name: openHAB Homematic Action | ||
Bundle-SymbolicName: org.openhab.action.homematic | ||
Bundle-Vendor: openHAB.org | ||
Bundle-Version: 1.6.0.qualifier | ||
Bundle-Activator: org.openhab.action.homematic.internal.HomematicActivator | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Description: This is the Homematic action of the open Home Aut | ||
omation Bus (openHAB) | ||
Import-Package: org.openhab.core.items, | ||
org.openhab.core.library.items, | ||
org.openhab.core.library.types, | ||
org.openhab.core.scriptengine.action, | ||
org.openhab.core.types, | ||
org.osgi.framework, | ||
org.osgi.service.cm, | ||
org.osgi.service.component, | ||
org.slf4j | ||
Bundle-DocURL: http://www.openhab.org | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 | ||
Service-Component: OSGI-INF/action.xml | ||
Bundle-ClassPath: . | ||
Bundle-ActivationPolicy: lazy | ||
Require-Bundle: org.openhab.binding.homematic;bundle-version="1.5.0" |
22 changes: 22 additions & 0 deletions
22
bundles/action/org.openhab.action.homematic/OSGI-INF/action.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,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2010-2014, openHAB.org 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" immediate="true" name="org.openhab.action.homematic.action"> | ||
<implementation class="org.openhab.action.homematic.internal.HomematicActionService" /> | ||
|
||
<service> | ||
<provide interface="org.openhab.core.scriptengine.action.ActionService" /> | ||
<provide interface="org.osgi.service.cm.ManagedService" /> | ||
</service> | ||
|
||
<property name="service.pid" type="String" value="org.openhab.homematic.action" /> | ||
|
||
</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,6 @@ | ||
source.. = src/main/java/,\ | ||
src/main/resources/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/ | ||
output.. = target/classes/ |
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,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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/maven-v4_0_0.xsd"> | ||
|
||
<parent> | ||
<groupId>org.openhab.bundles</groupId> | ||
<artifactId>action</artifactId> | ||
<version>1.6.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<properties> | ||
<bundle.symbolicName>org.openhab.action.homematic</bundle.symbolicName> | ||
<bundle.namespace>org.openhab.action.homematic</bundle.namespace> | ||
<deb.name>openhab-addon-action-homematic</deb.name> | ||
<deb.description>openhab addon action homematic</deb.description> | ||
</properties> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.openhab.action</groupId> | ||
<artifactId>org.openhab.action.homematic</artifactId> | ||
|
||
<name>openHAB Homematic Action</name> | ||
|
||
<packaging>eclipse-plugin</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.vafer</groupId> | ||
<artifactId>jdeb</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
67 changes: 67 additions & 0 deletions
67
...enhab.action.homematic/src/main/java/org/openhab/action/homematic/internal/Homematic.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,67 @@ | ||
/** | ||
* Copyright (c) 2010-2014, openHAB.org 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 | ||
*/ | ||
package org.openhab.action.homematic.internal; | ||
|
||
import org.openhab.binding.homematic.internal.common.HomematicContext; | ||
import org.openhab.binding.homematic.internal.communicator.client.HomematicClientException; | ||
import org.openhab.core.scriptengine.action.ActionDoc; | ||
import org.openhab.core.scriptengine.action.ParamDoc; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* This class provides static methods that can be used in automation rules for | ||
* sending messages to Homematic remote control displays. | ||
* | ||
* @author Gerhard Riegler | ||
* @since 1.5.0 | ||
*/ | ||
public class Homematic { | ||
private static HomematicContext context = HomematicContext.getInstance(); | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(Homematic.class); | ||
|
||
/** | ||
* Sends a text to a Homematic remote control display. | ||
*/ | ||
@ActionDoc(text = "Sends a text to a Homematic remote control display") | ||
public static boolean sendHomematicDisplay( | ||
@ParamDoc(name = "remoteControlAddress", text = "The address of the remote control") String remoteControlAddress, | ||
@ParamDoc(name = "text", text = "The text to send to the display") String text) { | ||
|
||
return sendDisplay(remoteControlAddress, text, null); | ||
} | ||
|
||
/** | ||
* Sends a text to a Homematic remote control display with options. | ||
*/ | ||
@ActionDoc(text = "Sends a text to a Homematic remote control display with options") | ||
public static boolean sendHomematicDisplay( | ||
@ParamDoc(name = "remoteControlAddress", text = "The address of the remote control") String remoteControlAddress, | ||
@ParamDoc(name = "text", text = "The text to send to the display") String text, | ||
@ParamDoc(name = "options", text = "The beep, backlight, unit and symbol options to send to the display") String options) { | ||
return sendDisplay(remoteControlAddress, text, options); | ||
} | ||
|
||
private static boolean sendDisplay(String remoteControlAddress, String text, String options) { | ||
if (!context.getHomematicClient().isStarted()) { | ||
logger.warn("The Homematic client is not started, ignoring action sendHomematicDisplay!"); | ||
return false; | ||
} else { | ||
try { | ||
context.getHomematicClient().setRemoteControlDisplay(remoteControlAddress, text, options); | ||
return true; | ||
} catch (HomematicClientException ex) { | ||
logger.error(ex.getMessage(), ex); | ||
return false; | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.