Merge branch 'master' of git.ctdo.de:bunti
This commit is contained in:
commit
e0cd2112ed
|
@ -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