Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
16 changes: 10 additions & 6 deletions bundles/org.openhab.binding.worxlandroid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,16 @@ As second step you are able to set time in percent and split in parts of 10 betw

### Schedule

| Channel | Type | ChannelName | |
|----------------|----------|-------------------------|-------------------|
| mode | String | schedule#mode | ONLY IF SUPPORTED |
| time-extension | Number | schedule#time-extension | |
| next-start | DateTime | schedule#next-start | |
| next-stop | DateTime | schedule#next-stop | |
| Channel | Type | ChannelName | |
|----------------|----------|-------------------------|----------------------|
| mode | String | schedule#mode | *1 ONLY IF SUPPORTED |
| time-extension | Number | schedule#time-extension | |
| next-start | DateTime | schedule#next-start | |
| next-stop | DateTime | schedule#next-stop | |

*1: Commands for **mode** Channel:

Normal, Party
Comment thread
lsiepel marked this conversation as resolved.
Outdated

### Aws

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2010-2026 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.worxlandroid.internal.codes;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link WorxLandroidModeCodes} hosts mode codes.
*
* @author Christoph Weitkamp - Initial contribution
*/
@NonNullByDefault
public enum WorxLandroidModeCodes {
NORMAL(1, "Normal"),
PARTY(2, "Party");

public final int code;
public final String description;

WorxLandroidModeCodes(int code, String description) {
this.code = code;
this.description = description;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.openhab.binding.worxlandroid.internal.api.dto.ProductItemStatus;
import org.openhab.binding.worxlandroid.internal.codes.WorxLandroidActionCodes;
import org.openhab.binding.worxlandroid.internal.codes.WorxLandroidDayCodes;
import org.openhab.binding.worxlandroid.internal.codes.WorxLandroidModeCodes;
import org.openhab.binding.worxlandroid.internal.codes.WorxLandroidStatusCodes;
import org.openhab.binding.worxlandroid.internal.config.MowerConfiguration;
import org.openhab.binding.worxlandroid.internal.vo.Mower;
Expand Down Expand Up @@ -241,7 +242,7 @@ protected void internalHandleCommand(@Nullable String groupId, String channelId,
} else if (GROUP_AWS.equals(groupId)) {
handleAWSCommand(theMower, channelId);
} else if (GROUP_SCHEDULE.equals(groupId)) {
handleScheduleCommand(theMower, channelId, Integer.parseInt(command.toString()));
handleScheduleCommand(theMower, channelId, command);
} else if (GROUP_ONE_TIME.equals(groupId)) {
handleOneTimeSchedule(theMower, channelId, command);
} else if (GROUP_COMMON.equals(groupId)) {
Expand Down Expand Up @@ -302,11 +303,13 @@ private void handleOneTimeSchedule(Mower theMower, String channel, Command comma
}
}

private void handleScheduleCommand(Mower theMower, String channel, int command) {
private void handleScheduleCommand(Mower theMower, String channel, Command command) {
if (CHANNEL_MODE.equals(channel)) {
sendCommand(theMower, new ScheduleCommand(command));
WorxLandroidModeCodes modeCode = WorxLandroidModeCodes.valueOf(command.toString().toUpperCase(Locale.ROOT));
sendCommand(theMower, new ScheduleCommand(modeCode.code));
} else if (CHANNEL_TIME_EXTENSION.equals(channel)) {
theMower.setTimeExtension(command);
int timeExtension = Integer.parseInt(command.toString());
theMower.setTimeExtension(timeExtension);
sendCommand(theMower,
theMower.scheduler2Supported()
? new ScheduleDaysCommand(theMower.getTimeExtension(), theMower.getScheduleArray1(),
Expand Down
Loading