From ad4a5a9c17285c41c657d2db42d15a844e3b6dd9 Mon Sep 17 00:00:00 2001 From: britea Date: Sat, 11 Apr 2020 18:30:47 +0200 Subject: [PATCH] Added intensity to knob-dimmer --- .../usi/inf/sa4/sanmarinoes/smarthut/models/KnobDimmer.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/KnobDimmer.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/KnobDimmer.java index c116165..dc39404 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/KnobDimmer.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/KnobDimmer.java @@ -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); }