Skip to content

Commit

Permalink
remove all warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitriy Ponomarev <diamond5170@gmail.com>
  • Loading branch information
MakeSimpleOrg committed Jun 3, 2017
1 parent ba87c33 commit 8b6bf92
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 147 deletions.
14 changes: 7 additions & 7 deletions addons/binding/org.openhab.binding.vera/.classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: .
Import-Package: com.google.common.collect,
com.google.gson,
com.google.gson.annotations;version="2.5.0",
com.google.gson.annotations,
org.apache.commons.lang,
org.apache.commons.lang.builder,
org.apache.commons.net.util,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,55 +1,63 @@
package org.openhab.binding.vera.controller;

public enum CategoryType {
Controller(0, "Controller"),
Interface(1, "Interface"),
DimmableLight(2, "Dimmable Light"),
Switch(3, "Switch"),
SecuritySensor(4, "Security Sensor"),
HVAC(5, "HVAC"),
Camera(6, "Camera"),
DoorLock(7, "Door Lock"),
WindowCovering(8, "Window Covering"),
RemoteControl(9, "Remote Control"),
IRTransmitter(10, "IR Transmitter"),
GenericIO(11, "Generic I/O"),
GenericSensor(12, "Generic Sensor"),
SerialPort(13, "Serial Port"),
SceneController(14, "Scene Controller"),
AV(15, "A/V"),
HumiditySensor(16, "Humidity Sensor"),
TemperatureSensor(17, "Temperature Sensor"),
LightSensor(18, "Light Sensor"),
ZWaveInterface(19, "Z-Wave Interface"),
InsteonInterface(20, "Insteon Interface"),
PowerMeter(21, "Power Meter"),
AlarmPanel(22, "Alarm Panel"),
AlarmPartition(23, "Alarm Partition"),
Siren(24, "Siren"),
Weather(25, "Weather"),
PhilipsController(26, "Philips Controller"),
Appliance(27, "Appliance"),
UVSensor(28, "UV Sensor"),
Unknown(-1, "Unknown");

private int id;
private String name;

private CategoryType(int id, String name) {
this.id = id;
this.name = name;
}

public int getId() {
return id;
}

public String getName() {
return name;
}

@Override
public String toString() {
return "{" + id + ", " + name + "}";
}
}
/**
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.openhab.binding.vera.controller;

public enum CategoryType {
Controller(0, "Controller"),
Interface(1, "Interface"),
DimmableLight(2, "Dimmable Light"),
Switch(3, "Switch"),
SecuritySensor(4, "Security Sensor"),
HVAC(5, "HVAC"),
Camera(6, "Camera"),
DoorLock(7, "Door Lock"),
WindowCovering(8, "Window Covering"),
RemoteControl(9, "Remote Control"),
IRTransmitter(10, "IR Transmitter"),
GenericIO(11, "Generic I/O"),
GenericSensor(12, "Generic Sensor"),
SerialPort(13, "Serial Port"),
SceneController(14, "Scene Controller"),
AV(15, "A/V"),
HumiditySensor(16, "Humidity Sensor"),
TemperatureSensor(17, "Temperature Sensor"),
LightSensor(18, "Light Sensor"),
ZWaveInterface(19, "Z-Wave Interface"),
InsteonInterface(20, "Insteon Interface"),
PowerMeter(21, "Power Meter"),
AlarmPanel(22, "Alarm Panel"),
AlarmPartition(23, "Alarm Partition"),
Siren(24, "Siren"),
Weather(25, "Weather"),
PhilipsController(26, "Philips Controller"),
Appliance(27, "Appliance"),
UVSensor(28, "UV Sensor"),
Unknown(-1, "Unknown");

private int id;
private String name;

private CategoryType(int id, String name) {
this.id = id;
this.name = name;
}

public int getId() {
return id;
}

public String getName() {
return name;
}

@Override
public String toString() {
return "{" + id + ", " + name + "}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,6 @@ protected synchronized void addDeviceAsChannel(Device device) {
case HVAC: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case Camera: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case DoorLock:
id = DOORLOCK_CHANNEL;
acceptedItemType = "Switch";
Expand All @@ -356,29 +353,14 @@ protected synchronized void addDeviceAsChannel(Device device) {
id = SWITCH_ROLLERSHUTTER_CHANNEL;
acceptedItemType = "Rollershutter";
break;
case RemoteControl: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case IRTransmitter: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case GenericIO: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case GenericSensor:
id = SENSOR_BINARY_CHANNEL;
acceptedItemType = "Switch";
break;
case SerialPort: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case SceneController:
id = SWITCH_BINARY_CHANNEL;
acceptedItemType = "Switch";
break;
case AV: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case HumiditySensor:
id = SENSOR_HUMIDITY_CHANNEL;
acceptedItemType = "Number";
Expand All @@ -391,38 +373,30 @@ protected synchronized void addDeviceAsChannel(Device device) {
id = SENSOR_LUMINOSITY_CHANNEL;
acceptedItemType = "Number";
break;
case ZWaveInterface: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case InsteonInterface: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case PowerMeter:
id = SENSOR_ENERGY_CHANNEL;
acceptedItemType = "Number";
break;
case AlarmPanel: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case AlarmPartition: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case Siren: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case Weather: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case PhilipsController: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case Appliance: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case UVSensor:
id = SENSOR_ULTRAVIOLET_CHANNEL;
acceptedItemType = "Number";
break;
case Camera:
case RemoteControl:
case IRTransmitter:
case GenericIO:
case SerialPort:
case AV:
case ZWaveInterface:
case InsteonInterface:
case AlarmPanel:
case AlarmPartition:
case Siren:
case Weather:
case PhilipsController:
case Appliance:
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case Unknown:
logger.warn("Unknown device type: {}, {}", device, device.getCategory());
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,66 +66,40 @@ public static State toState(Device device, Channel channel, Logger logger) {
case HVAC: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case Camera: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case DoorLock:
return getBinaryState(device.getLocked());
case WindowCovering:
return getPercentState(device.getLevel());
case RemoteControl: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case IRTransmitter: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case GenericIO: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case GenericSensor:
return getMultilevelState(device.getLevel());
case SerialPort: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case SceneController:
return getBinaryState(device.getStatus());
case AV: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case HumiditySensor:
return getMultilevelState(device.getHumidity());
case TemperatureSensor:
return getMultilevelState(device.getTemperature());
case LightSensor:
return getMultilevelState(device.getLight());
case ZWaveInterface: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case InsteonInterface: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case PowerMeter:
return getMultilevelState(device.getLevel());
case AlarmPanel: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case AlarmPartition: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case Siren: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case Weather: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case PhilipsController: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case Appliance: // TODO
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case UVSensor:
return getMultilevelState(device.getLevel());
case Camera:
case AV:
case ZWaveInterface:
case InsteonInterface:
case RemoteControl:
case IRTransmitter:
case GenericIO:
case SerialPort:
case AlarmPanel:
case AlarmPartition:
case Siren:
case Weather:
case PhilipsController:
case Appliance:
logger.warn("TODO: {}, {}", device, device.getCategoryType());
break;
case Unknown:
logger.warn("Unknown device type: {}, {}", device, device.getCategory());
break;
Expand Down

0 comments on commit 8b6bf92

Please sign in to comment.