]> git.basschouten.com Git - openhab-addons.git/commitdiff
[rfxcom] Support for Lucciair DC Speed (#12038)
authorMartin van Wingerden <martin@martinvw.nl>
Sat, 5 Mar 2022 09:34:31 +0000 (10:34 +0100)
committerGitHub <noreply@github.com>
Sat, 5 Mar 2022 09:34:31 +0000 (10:34 +0100)
* [rfxcom] Support speed for luca DC version
* [rfxcom] Handle null value for speed
* [rfxcom] Update readme and add migration channel

Signed-off-by: Martin van Wingerden <martin@martinvw.nl>
bundles/org.openhab.binding.rfxcom/README.md
bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanMessage.java
bundles/org.openhab.binding.rfxcom/src/main/resources/OH-INF/thing/fan_lucci_dc.xml
bundles/org.openhab.binding.rfxcom/src/main/resources/OH-INF/thing/fan_novy.xml

index a931a37811d7ac8aa4244f4ce0d604eb68500a5a..8cc9863804646464c44f3fc167dc50775f7b6c9b 100644 (file)
@@ -499,12 +499,13 @@ A Lucci Air DC fan device
 
 ##### Channels
 
-| Name         | Channel Type                        | Item Type     | Remarks                                                       |
-|--------------|-------------------------------------|---------------|---------------------------------------------------------------|
-| commandString| [commandString](#channels)          | String        | Options: POWER, UP, DOWN, LIGHT, REVERSE, NATURAL_FLOW, PAIR  |
-| fanSpeed     | [fanspeedcontrol](#channels)        | RollerShutter | Options: UP / DOWN                                            |
-| fanLight     | [fanlight](#channels)               | Switch        |                                                               |
-| signalLevel  | [system.signal-strength](#channels) | Number        |                                                               |
+| Name            | Channel Type                        | Item Type     | Remarks                                                      |
+|-----------------|-------------------------------------|---------------|--------------------------------------------------------------|
+| commandString   | [commandString](#channels)          | String        | Options: POWER, UP, DOWN, LIGHT, REVERSE, NATURAL_FLOW, PAIR |
+| fanSpeedControl | [fanspeedcontrol](#channels)        | RollerShutter | Options: UP / DOWN                                           |
+| fanSpeed        | [fanspeed](#channels)               | Number        | Options: 1,2,3,4,5,6                                         |
+| fanLight        | [fanlight](#channels)               | Switch        |                                                              |
+| signalLevel     | [system.signal-strength](#channels) | Number        |                                                              |
 
 ##### Configuration Options
 
@@ -542,13 +543,13 @@ A Novy extractor fan.
 
 ##### Channels
 
-| Name         | Channel Type                        | Item Type     | Remarks                  |
-|--------------|-------------------------------------|---------------|--------------------------|
-| command      | [command](#channels)                | Switch        |                          |
-| commandString| [commandString](#channels)          | String        | Options: POWER, UP, DOWN, LIGHT, LEARN, RESET_FILTER |
-| fanSpeed     | [fanspeedcontrol](#channels)        | RollerShutter | Options: UP / DOWN       |
-| fanLight     | [fanlight](#channels)               | Switch        |                          |
-| signalLevel  | [system.signal-strength](#channels) | Number        |                          |
+| Name            | Channel Type                        | Item Type     | Remarks                  |
+|-----------------|-------------------------------------|---------------|--------------------------|
+| command         | [command](#channels)                | Switch        |                          |
+| commandString   | [commandString](#channels)          | String        | Options: POWER, UP, DOWN, LIGHT, LEARN, RESET_FILTER |
+| fanSpeedControl | [fanspeedcontrol](#channels)        | RollerShutter | Options: UP / DOWN       |
+| fanLight        | [fanlight](#channels)               | Switch        |                          |
+| signalLevel     | [system.signal-strength](#channels) | Number        |                          |
 
 ##### Configuration Options
 
index 831d0931af9491e41264ee7f29fd351bbe4fb585..ccb6b6087656348a7b992b6b6235df04d4d309a9 100644 (file)
@@ -106,6 +106,12 @@ public class RFXComFanMessage extends RFXComDeviceMessageImpl<RFXComFanMessage.S
         LUCCI_AIR_DC_REVERSE(5, LUCCI_AIR_DC),
         LUCCI_AIR_DC_NATURAL_FLOW(6, LUCCI_AIR_DC),
         LUCCI_AIR_DC_PAIR(7, LUCCI_AIR_DC),
+        LUCCI_AIR_DC_SPEED_1(8, 1, LUCCI_AIR_DC),
+        LUCCI_AIR_DC_SPEED_2(9, 2, LUCCI_AIR_DC),
+        LUCCI_AIR_DC_SPEED_3(10, 3, LUCCI_AIR_DC),
+        LUCCI_AIR_DC_SPEED_4(11, 4, LUCCI_AIR_DC),
+        LUCCI_AIR_DC_SPEED_5(12, 5, LUCCI_AIR_DC),
+        LUCCI_AIR_DC_SPEED_6(13, 6, LUCCI_AIR_DC),
 
         LUCCI_AIR_DC_II_POWER_OFF(1, 0, LUCCI_AIR_DC_II),
         LUCCI_AIR_DC_II_SPEED_1(2, 1, LUCCI_AIR_DC_II),
@@ -141,7 +147,7 @@ public class RFXComFanMessage extends RFXComDeviceMessageImpl<RFXComFanMessage.S
         @Nullable
         public static Commands bySpeed(SubType subType, int speed) {
             for (Commands value : values()) {
-                if (value.supportedBySubTypes.contains(subType) && value.speed == speed) {
+                if (value.supportedBySubTypes.contains(subType) && value.speed != null && value.speed == speed) {
                     return value;
                 }
             }
@@ -169,7 +175,9 @@ public class RFXComFanMessage extends RFXComDeviceMessageImpl<RFXComFanMessage.S
             LUCCI_AIR_DC_II_LIGHT, FALMEC_LIGHT_ON, NOVY_LIGHT);
     private static final List<Commands> ON_COMMANDS = Arrays.asList(HI, MED, LOW, FALMEC_SPEED_1, FALMEC_SPEED_2,
             FALMEC_SPEED_3, FALMEC_SPEED_4, LUCCI_AIR_DC_II_SPEED_1, LUCCI_AIR_DC_II_SPEED_2, LUCCI_AIR_DC_II_SPEED_3,
-            LUCCI_AIR_DC_II_SPEED_4, LUCCI_AIR_DC_II_SPEED_5, LUCCI_AIR_DC_II_SPEED_6);
+            LUCCI_AIR_DC_II_SPEED_4, LUCCI_AIR_DC_II_SPEED_5, LUCCI_AIR_DC_II_SPEED_6, LUCCI_AIR_DC_SPEED_1,
+            LUCCI_AIR_DC_SPEED_2, LUCCI_AIR_DC_SPEED_3, LUCCI_AIR_DC_SPEED_4, LUCCI_AIR_DC_SPEED_5,
+            LUCCI_AIR_DC_SPEED_6);
     private static final List<Commands> OFF_COMMANDS = Arrays.asList(OFF, FALMEC_POWER_OFF, LUCCI_AIR_DC_II_POWER_OFF);
 
     private SubType subType;
@@ -321,6 +329,12 @@ public class RFXComFanMessage extends RFXComDeviceMessageImpl<RFXComFanMessage.S
             case FT1211R_SPEED_3:
             case FT1211R_SPEED_4:
             case FT1211R_SPEED_5:
+            case LUCCI_AIR_DC_SPEED_1:
+            case LUCCI_AIR_DC_SPEED_2:
+            case LUCCI_AIR_DC_SPEED_3:
+            case LUCCI_AIR_DC_SPEED_4:
+            case LUCCI_AIR_DC_SPEED_5:
+            case LUCCI_AIR_DC_SPEED_6:
             case LUCCI_AIR_DC_II_POWER_OFF:
             case LUCCI_AIR_DC_II_SPEED_1:
             case LUCCI_AIR_DC_II_SPEED_2:
@@ -460,6 +474,9 @@ public class RFXComFanMessage extends RFXComDeviceMessageImpl<RFXComFanMessage.S
 
                 case LUCCI_AIR_DC_II:
                     return LUCCI_AIR_DC_II_LIGHT;
+
+                default:
+                    // return exception
             }
         } else if (type == OnOffType.OFF && subType == FALMEC) {
             return Commands.FALMEC_LIGHT_OFF;
index 847de91075aff382010ba1cf3e9635309d38a7d2..ad78536c5b0866ce57d4b81131a4c7d3b41ea418 100644 (file)
@@ -17,7 +17,8 @@
 
                <channels>
                        <channel id="commandString" typeId="commandString"/>
-                       <channel id="fanSpeed" typeId="fanspeedcontrol"/>
+                       <channel id="fanSpeedControl" typeId="fanspeedcontrol"/>
+                       <channel id="fanSpeed" typeId="fanspeed"/>
                        <channel id="fanLight" typeId="command"/>
                        <channel id="signalLevel" typeId="system.signal-strength"/>
                </channels>
index 1fc31a9c4433afdced7d7c4a467dd452e171a1d7..65b8b2890ee9f1659b6740624d90e78e36ccd844 100644 (file)
@@ -17,6 +17,8 @@
 
                <channels>
                        <channel id="commandString" typeId="commandString"/>
+                       <channel id="fanSpeedControl" typeId="fanspeedcontrol"/>
+                       <!-- Deprecated fanSpeed should only be used for the numeric channel fanspeed -->
                        <channel id="fanSpeed" typeId="fanspeedcontrol"/>
                        <channel id="fanLight" typeId="command"/>
                        <channel id="signalLevel" typeId="system.signal-strength"/>