From 3b77d114fc9ec6f7a5bc7c7ad29b1c9507cd5543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20L=27hopital?= Date: Tue, 19 Apr 2022 19:17:14 +0200 Subject: [PATCH] [somfytahoma] Adding Moving channel to Rollershutter (#12605) * Adding Moving channel to Rollershutter Signed-off-by: clinique --- bundles/org.openhab.binding.somfytahoma/README.md | 1 + .../somfytahoma/internal/SomfyTahomaBindingConstants.java | 5 ++++- .../internal/handler/SomfyTahomaRollerShutterHandler.java | 1 + .../src/main/resources/OH-INF/i18n/somfytahoma.properties | 2 ++ .../src/main/resources/OH-INF/thing/channels.xml | 7 +++++++ .../src/main/resources/OH-INF/thing/rollershutter.xml | 1 + 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.somfytahoma/README.md b/bundles/org.openhab.binding.somfytahoma/README.md index 689fc84539a..caf52f72a58 100644 --- a/bundles/org.openhab.binding.somfytahoma/README.md +++ b/bundles/org.openhab.binding.somfytahoma/README.md @@ -73,6 +73,7 @@ Please see the example below. | gate | gate_state | get state of your gate (open, closed, pedestrian) | | gate | gate_position | get position (0-100%) of your gate (where supported) | | roller shutter, shutter, screen, ven. blind, garage door, awning, pergola, curtain | control | device controller which reacts to commands UP/DOWN/ON/OFF/OPEN/CLOSE/MY/STOP + closure 0-100 | +| roller shutter | moving | Indicates if the device is currently operating a command | | window | control | device controller which reacts to commands UP/DOWN/ON/OFF/OPEN/CLOSE/STOP + closure 0-100 | | silent roller shutter | silent_control | similar to control channel but in silent mode | | venetian blind, adjustable slats roller shutter, bioclimatic pergola | orientation | percentual orientation of the blind's slats, it can have value 0-100. For IO Homecontrol devices only (non RTS) | diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java index 6e0d68b3824..394f18669c5 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java @@ -187,6 +187,7 @@ public class SomfyTahomaBindingConstants { // Roller shutter, Shutter, Awning, Screen, Blind, Garage door, Window, Curtain public static final String CONTROL = "control"; + public static final String MOVING = "moving"; // Adjustable slats roller shutter public static final String ROCKER = "rocker"; @@ -511,7 +512,9 @@ public class SomfyTahomaBindingConstants { THING_TYPE_HITACHI_DHW, THING_TYPE_HITACHI_ATWMC, THING_TYPE_RAINSENSOR, THING_TYPE_SHUTTER)); // somfy gateways - public static Map gatewayTypes = new HashMap() { + public static Map gatewayTypes = new HashMap<>() { + private static final long serialVersionUID = 7473481667820682573L; + { put(0, "VIRTUAL_KIZBOX"); put(2, "KIZBOX_V1"); diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaRollerShutterHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaRollerShutterHandler.java index e6d95d7b95a..edbc34d92cd 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaRollerShutterHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaRollerShutterHandler.java @@ -33,6 +33,7 @@ public class SomfyTahomaRollerShutterHandler extends SomfyTahomaBaseThingHandler public SomfyTahomaRollerShutterHandler(Thing thing) { super(thing); stateNames.put(CONTROL, "core:ClosureState"); + stateNames.put(MOVING, "core:MovingState"); } @Override diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/i18n/somfytahoma.properties b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/i18n/somfytahoma.properties index d0ee641ec1c..a08acf6d163 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/i18n/somfytahoma.properties +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/i18n/somfytahoma.properties @@ -151,6 +151,8 @@ channel-type.somfytahoma.contact.label = Contact channel-type.somfytahoma.contact.description = A contact having OPEN/CLOSE state channel-type.somfytahoma.control.label = Control channel-type.somfytahoma.control.description = Device control (UP, DOWN, MY/STOP, closure 0-100%) +channel-type.somfytahoma.moving.label = Moving +channel-type.somfytahoma.moving.description = Indicates if the device is currently operating a command channel-type.somfytahoma.control_silent.label = Control (silent) channel-type.somfytahoma.control_silent.description = Device control (UP, DOWN, MY/STOP, closure 0-100%) (only for IO devices) channel-type.somfytahoma.current_heating_mode.label = Current Heating Mode diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/channels.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/channels.xml index 448d1b93024..d3dca6bedc5 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/channels.xml @@ -30,6 +30,13 @@ + + Switch + + Indicates if the device is currently operating a command. + + + Number:Illuminance diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/rollershutter.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/rollershutter.xml index 46778dc7aae..41437867942 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/rollershutter.xml +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/rollershutter.xml @@ -11,6 +11,7 @@ + url