package de.tu_darmstadt.tk.SmartHomeNetworkSim.core.devices;

import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.RoomStatus;

public class SmartLight extends BoolSensorDevice implements SensorLabel {

	RoomStatus roomStatus;
	private boolean trueStatus = false;
	private SmartLightSensor sensor;
	
	public SmartLight(String name, RoomStatus roomStatus, SmartLightSensor sensor) {
		super(name);
		this.roomStatus = roomStatus;
		this.sensor = sensor;
	}

	@Override
	public void simulateTimeStep(long startTime, long duration) {
		/**
		 * Do nothing
		 */
	}
	
	/**
	 * @return the trueStatus
	 */
	public boolean isTrueStatus() {
		return trueStatus;
	}
	/**
	 * @param trueStatus the trueStatus to set
	 */
	public void setTrueStatus(boolean trueStatus) {
		this.trueStatus = trueStatus;
		roomStatus.setLightOn(trueStatus);
	}

	@Override
	public String getSensorLabel() {
		return "" + sensor.getBSval();
	}

}
