forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[omnilink] Initial contribution (openhab#8922)
Signed-off-by: Ethan Dye <[email protected]> Co-authored-by: Dan Cunningham <[email protected]> Co-authored-by: Craig Hamilton <[email protected]> Co-authored-by: Brian O'Connell <[email protected]> Co-authored-by: Dan Cunningham <[email protected]> Co-authored-by: Craig Hamilton <[email protected]> Co-authored-by: Brian O'Connell <[email protected]> Signed-off-by: John Marshall <[email protected]>
- Loading branch information
1 parent
f75d1b7
commit 139d314
Showing
53 changed files
with
6,820 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,20 @@ | ||
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 | ||
|
||
== Third-party Content | ||
|
||
jomnilink | ||
* License: EPL-2.0 | ||
* Project: https://github.com/digitaldan/jomnilink | ||
* Source: https://github.com/digitaldan/jomnilink |
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,26 @@ | ||
<?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.1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.openhab.binding.omnilink</artifactId> | ||
|
||
<name>openHAB Add-ons :: Bundles :: OmniLink Binding</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.github.digitaldan</groupId> | ||
<artifactId>jomnilink</artifactId> | ||
<version>1.4.0</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
23 changes: 23 additions & 0 deletions
23
bundles/org.openhab.binding.omnilink/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-2021 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.omnilink-${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-omnilink" description="OmniLink Binding" version="${project.version}"> | ||
<feature>openhab-runtime-base</feature> | ||
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.omnilink/${project.version}</bundle> | ||
</feature> | ||
</features> |
57 changes: 57 additions & 0 deletions
57
...enhab.binding.omnilink/src/main/java/org/openhab/binding/omnilink/internal/AreaAlarm.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,57 @@ | ||
/** | ||
* Copyright (c) 2010-2021 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.omnilink.internal; | ||
|
||
import static org.openhab.binding.omnilink.internal.OmnilinkBindingConstants.*; | ||
|
||
import java.math.BigInteger; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* The {@link AreaAlarm} class defines the different types of alarms supported | ||
* by the OmniLink Protocol. | ||
* | ||
* @author Craig Hamilton - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public enum AreaAlarm { | ||
BURGLARY(CHANNEL_AREA_ALARM_BURGLARY, 0), | ||
FIRE(CHANNEL_AREA_ALARM_FIRE, 1), | ||
GAS(CHANNEL_AREA_ALARM_GAS, 2), | ||
AUXILIARY(CHANNEL_AREA_ALARM_AUXILIARY, 3), | ||
FREEZE(CHANNEL_AREA_ALARM_FREEZE, 4), | ||
WATER(CHANNEL_AREA_ALARM_WATER, 5), | ||
DURESS(CHANNEL_AREA_ALARM_DURESS, 6), | ||
TEMPERATURE(CHANNEL_AREA_ALARM_TEMPERATURE, 7); | ||
|
||
private final String channelUID; | ||
private final int bit; | ||
|
||
AreaAlarm(String channelUID, int bit) { | ||
this.channelUID = channelUID; | ||
this.bit = bit; | ||
} | ||
|
||
public boolean isSet(BigInteger alarmBits) { | ||
return alarmBits.testBit(bit); | ||
} | ||
|
||
public boolean isSet(int alarmBits) { | ||
return isSet(BigInteger.valueOf(alarmBits)); | ||
} | ||
|
||
public String getChannelUID() { | ||
return channelUID; | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
...hab.binding.omnilink/src/main/java/org/openhab/binding/omnilink/internal/AudioPlayer.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,76 @@ | ||
/** | ||
* Copyright (c) 2010-2021 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.omnilink.internal; | ||
|
||
import java.util.Arrays; | ||
import java.util.Optional; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* The {@link AudioPlayer} defines some methods that are used to | ||
* interface with an OmniLink Audio Player. | ||
* | ||
* @author Brian O'Connell - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public enum AudioPlayer { | ||
NUVO(1, 6, 8, 7, 9, 10), | ||
NUVO_GRAND_ESSENTIA_SIMPLESE(2, 6, 8, 7, 9, 10), | ||
NUVO_GRAND_GRAND_CONCERTO(3, 6, 6, 6, 9, 10), | ||
RUSSOUND(4, 6, 8, 7, 11, 12), | ||
XANTECH(6, 13, 15, 14, 16, 17), | ||
SPEAKERCRAFT(7, 45, 44, 46, 42, 43), | ||
PROFICIENT(8, 45, 44, 46, 42, 43); | ||
|
||
private final int featureCode; | ||
private final int playCommand; | ||
private final int pauseCommand; | ||
private final int stopCommand; | ||
private final int previousCommand; | ||
private final int nextCommand; | ||
|
||
AudioPlayer(int featureCode, int playCommand, int pauseCommand, int stopCommand, int previousCommand, | ||
int nextCommand) { | ||
this.featureCode = featureCode; | ||
this.playCommand = playCommand; | ||
this.pauseCommand = pauseCommand; | ||
this.stopCommand = stopCommand; | ||
this.previousCommand = previousCommand; | ||
this.nextCommand = nextCommand; | ||
} | ||
|
||
public int getPlayCommand() { | ||
return playCommand; | ||
} | ||
|
||
public int getPauseCommand() { | ||
return pauseCommand; | ||
} | ||
|
||
public int getStopCommand() { | ||
return stopCommand; | ||
} | ||
|
||
public int getPreviousCommand() { | ||
return previousCommand; | ||
} | ||
|
||
public int getNextCommand() { | ||
return nextCommand; | ||
} | ||
|
||
public static Optional<AudioPlayer> getAudioPlayerForFeatureCode(int featureCode) { | ||
return Arrays.stream(values()).filter(v -> v.featureCode == featureCode).findAny(); | ||
} | ||
} |
Oops, something went wrong.