Merge branch 'knob-dimmer-fix' into 'dev'
Added intensity to knob-dimmer See merge request sa4-2020/the-sanmarinoes/backend!72
This commit is contained in:
commit
82419d3368
1 changed files with 5 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
package ch.usi.inf.sa4.sanmarinoes.smarthut.models;
|
package ch.usi.inf.sa4.sanmarinoes.smarthut.models;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,6 +10,9 @@ import javax.persistence.Entity;
|
||||||
@Entity
|
@Entity
|
||||||
public class KnobDimmer extends Dimmer {
|
public class KnobDimmer extends Dimmer {
|
||||||
|
|
||||||
|
@Column
|
||||||
|
Integer intensity = 0;
|
||||||
|
|
||||||
public KnobDimmer() {
|
public KnobDimmer() {
|
||||||
super("knobDimmer");
|
super("knobDimmer");
|
||||||
}
|
}
|
||||||
|
@ -19,6 +23,7 @@ public class KnobDimmer extends Dimmer {
|
||||||
* @param intensity the intensity (must be from 0 to 100)
|
* @param intensity the intensity (must be from 0 to 100)
|
||||||
*/
|
*/
|
||||||
public void setLightIntensity(int intensity) {
|
public void setLightIntensity(int intensity) {
|
||||||
|
this.intensity = intensity;
|
||||||
for (DimmableLight dl : getOutputs()) {
|
for (DimmableLight dl : getOutputs()) {
|
||||||
dl.setIntensity(intensity);
|
dl.setIntensity(intensity);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue