Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hdpowerview] Support refresh command for battery-related channels #11933

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,25 @@ public void initialize() {

@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());
Expand Down