implemented switching device
This commit is contained in:
parent
7dfb3f91a3
commit
6f2614350b
|
@ -9,13 +9,9 @@ import java.util.List;
|
|||
public final class RoomsDAOImpl extends HibernateDaoSupport implements RoomsDAO {
|
||||
|
||||
public RoomsDAOImpl() {
|
||||
addDummyRooms();
|
||||
|
||||
}
|
||||
|
||||
private void addDummyRooms() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Room> getRooms() {
|
||||
|
|
|
@ -3,17 +3,38 @@ package de.ctdo.bunti.model;
|
|||
import java.util.Map;
|
||||
|
||||
public abstract class BuntiSwitchingDevice extends BuntiDevice {
|
||||
private static final String OPTION_STATE = "state";
|
||||
|
||||
private boolean state = false;
|
||||
|
||||
public BuntiSwitchingDevice(int deviceId, String deviceName) {
|
||||
super(deviceId, deviceName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public final boolean setValuesFromOptions(Map<String, Object> options) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
if(options.containsKey(OPTION_STATE)) {
|
||||
|
||||
try {
|
||||
boolean value = Boolean.parseBoolean(options.get(OPTION_STATE).toString());
|
||||
setState(value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(boolean state) {
|
||||
this.state = state;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,6 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: lucas
|
||||
* @date: 15.03.12 21:51
|
||||
*/
|
||||
public final class Room {
|
||||
|
||||
private int id;
|
||||
|
|
Loading…
Reference in New Issue