diff --git a/bundles/org.openhab.binding.hdpowerview/README.md b/bundles/org.openhab.binding.hdpowerview/README.md index 023e6213991..180bbc6120a 100644 --- a/bundles/org.openhab.binding.hdpowerview/README.md +++ b/bundles/org.openhab.binding.hdpowerview/README.md @@ -156,6 +156,17 @@ then end ``` +For single shades the refresh takes the item's channel into consideration: + +| Channel | Hard refresh kind | +|----------------|-------------------| +| position | Position | +| secondary | Position | +| vane | Position | +| lowBattery | Battery | +| batteryLevel | Battery | +| batteryVoltage | Battery | + ## Full Example ### `demo.things` File diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewShadeHandler.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewShadeHandler.java index 038b4f71a37..e996b58ce33 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewShadeHandler.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewShadeHandler.java @@ -104,12 +104,25 @@ public class HDPowerViewShadeHandler extends AbstractHubbedThingHandler { @Override public void handleCommand(ChannelUID channelUID, Command command) { - if (RefreshType.REFRESH.equals(command)) { - requestRefreshShadePosition(); + String channelId = channelUID.getId(); + + if (RefreshType.REFRESH == command) { + switch (channelId) { + case CHANNEL_SHADE_POSITION: + case CHANNEL_SHADE_SECONDARY_POSITION: + case CHANNEL_SHADE_VANE: + requestRefreshShadePosition(); + break; + case CHANNEL_SHADE_LOW_BATTERY: + case CHANNEL_SHADE_BATTERY_LEVEL: + case CHANNEL_SHADE_BATTERY_VOLTAGE: + requestRefreshShadeBatteryLevel(); + break; + } return; } - switch (channelUID.getId()) { + switch (channelId) { case CHANNEL_SHADE_POSITION: if (command instanceof PercentType) { moveShade(PRIMARY_ACTUATOR, ZERO_IS_CLOSED, ((PercentType) command).intValue());