-
-
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.
[rfxcom] Add Novy extractor fans (#10891)
- Loading branch information
Showing
8 changed files
with
184 additions
and
31 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
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
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
41 changes: 41 additions & 0 deletions
41
bundles/org.openhab.binding.rfxcom/src/main/resources/OH-INF/thing/fan_novy.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,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<thing:thing-descriptions bindingId="rfxcom" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" | ||
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> | ||
|
||
<thing-type id="fan_novy"> | ||
<supported-bridge-type-refs> | ||
<bridge-type-ref id="bridge"/> | ||
<bridge-type-ref id="tcpbridge"/> | ||
<bridge-type-ref id="RFXtrx433"/> | ||
<bridge-type-ref id="RFXrec433"/> | ||
</supported-bridge-type-refs> | ||
|
||
<label>RFXCOM Fan Device - Novy Extractor Fan</label> | ||
<description>A Novy extractor fan.</description> | ||
|
||
<channels> | ||
<channel id="commandString" typeId="commandString"/> | ||
<channel id="fanSpeed" typeId="fanspeedcontrol"/> | ||
<channel id="fanLight" typeId="command"/> | ||
<channel id="signalLevel" typeId="system.signal-strength"/> | ||
</channels> | ||
|
||
<config-description> | ||
<parameter name="deviceId" type="text" required="true"> | ||
<label>Device Id</label> | ||
<description>Unit Id. Example 1000</description> | ||
</parameter> | ||
<parameter name="subType" type="text"> | ||
<label>Sub Type</label> | ||
<description>Specifies device sub type.</description> | ||
<options> | ||
<option value="NOVY">Novy extractor fan</option> | ||
</options> | ||
<default>NOVY</default> | ||
</parameter> | ||
</config-description> | ||
</thing-type> | ||
|
||
</thing:thing-descriptions> |
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
68 changes: 68 additions & 0 deletions
68
...xcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanNovyMessage.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,68 @@ | ||
/** | ||
* 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.rfxcom.internal.messages; | ||
|
||
import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; | ||
import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.FAN_NOVY; | ||
import static org.openhab.binding.rfxcom.internal.messages.RFXComFanMessage.SubType.NOVY; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.eclipse.jdt.annotation.Nullable; | ||
import org.junit.jupiter.api.Test; | ||
import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; | ||
import org.openhab.core.library.types.OnOffType; | ||
import org.openhab.core.library.types.StringType; | ||
import org.openhab.core.library.types.UpDownType; | ||
import org.openhab.core.types.State; | ||
import org.openhab.core.types.UnDefType; | ||
|
||
/** | ||
* Test for RFXCom-binding | ||
* | ||
* @author Martin van Wingerden - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class RFXComFanNovyMessage { | ||
|
||
@Test | ||
public void testUp() throws RFXComException { | ||
testCommand(CHANNEL_FAN_SPEED, UpDownType.UP, UnDefType.UNDEF, UpDownType.UP, StringType.valueOf("UP")); | ||
} | ||
|
||
@Test | ||
public void testDown() throws RFXComException { | ||
testCommand(CHANNEL_FAN_SPEED, UpDownType.DOWN, UnDefType.UNDEF, UpDownType.DOWN, StringType.valueOf("DOWN")); | ||
} | ||
|
||
@Test | ||
public void testCommandString() throws RFXComException { | ||
testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("POWER"), UnDefType.UNDEF, null, | ||
StringType.valueOf("POWER")); | ||
testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("UP"), UnDefType.UNDEF, UpDownType.UP, | ||
StringType.valueOf("UP")); | ||
testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("DOWN"), UnDefType.UNDEF, UpDownType.DOWN, | ||
StringType.valueOf("DOWN")); | ||
testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("LIGHT"), OnOffType.ON, null, | ||
StringType.valueOf("LIGHT")); | ||
testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("LEARN"), UnDefType.UNDEF, null, | ||
StringType.valueOf("LEARN")); | ||
testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("RESET_FILTER"), UnDefType.UNDEF, null, | ||
StringType.valueOf("RESET_FILTER")); | ||
} | ||
|
||
private void testCommand(String channel, State inputValue, State expectedLightCommand, | ||
@Nullable State expectedFanSpeed, State expectedCommandString) throws RFXComException { | ||
RFXComFanMessageTest.testCommand(NOVY, channel, inputValue, null, expectedLightCommand, expectedFanSpeed, | ||
expectedCommandString, FAN_NOVY); | ||
} | ||
} |