Added intensity to knob-dimmer

This commit is contained in:
britea 2020-04-11 18:30:47 +02:00
parent 9575018b2e
commit ad4a5a9c17

View File

@ -1,5 +1,6 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut.models;
import javax.persistence.Column;
import javax.persistence.Entity;
/**
@ -9,6 +10,9 @@ import javax.persistence.Entity;
@Entity
public class KnobDimmer extends Dimmer {
@Column
Integer intensity = 0;
public KnobDimmer() {
super("knobDimmer");
}
@ -19,6 +23,7 @@ public class KnobDimmer extends Dimmer {
* @param intensity the intensity (must be from 0 to 100)
*/
public void setLightIntensity(int intensity) {
this.intensity = intensity;
for (DimmableLight dl : getOutputs()) {
dl.setIntensity(intensity);
}