import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
-import org.apache.commons.lang.StringUtils;
import org.openhab.core.thing.ThingStatus;
import org.openhab.core.thing.ThingStatusDetail;
import org.openhab.core.types.State;
*/
@Override
public void stateChanged(String channelId, State state) {
- if (StringUtils.isEmpty(channelId)) {
+ if (channelId == null || "".equals(channelId)) {
return;
}
* @param channelId the channel id to remove state
*/
public void removeState(String channelId) {
- if (StringUtils.isEmpty(channelId)) {
+ if (channelId == null || "".equals(channelId)) {
return;
}
state.remove(channelId);
break;
case AtlonaPro3Constants.CHANNEL_VOLUME:
if (command instanceof DecimalType) {
- final double level = ((DecimalType) command).doubleValue();
+ final int level = ((DecimalType) command).intValue();
atlonaHandler.setVolume(portNbr, level);
} else {
logger.debug("Received a VOLUME channel command with a non DecimalType: {}", command);
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.commons.lang.StringUtils;
import org.openhab.binding.atlona.internal.AtlonaHandlerCallback;
import org.openhab.binding.atlona.internal.net.SocketSession;
import org.openhab.binding.atlona.internal.net.SocketSessionListener;
* @param portNbr a greater than zero port number
* @param level a volume level in decibels (must range from -79 to +15)
*/
- void setVolume(int portNbr, double level) {
+ void setVolume(int portNbr, int level) {
if (portNbr <= 0) {
throw new IllegalArgumentException("portNbr must be greater than 0");
}
int hdmiPortNbr = Integer.parseInt(m.group(1));
// could be "off" (if mirror off), "on"/"Out" (with 3rd group representing out)
- String oper = StringUtils.trimToEmpty(m.group(2)).toLowerCase();
+ String oper = (m.group(2) == null ? "" : m.group(2).trim()).toLowerCase();
if (oper.equals("off")) {
callback.stateChanged(AtlonaPro3Utilities.createChannelID(AtlonaPro3Constants.GROUP_MIRROR,