diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java index bc093e0..e72cbf6 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java @@ -2,6 +2,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import ch.usi.inf.sa4.sanmarinoes.smarthut.config.GsonExclude; import ch.usi.inf.sa4.sanmarinoes.smarthut.config.SocketGsonExclude; +import java.util.HashSet; import java.util.Set; import javax.persistence.*; import javax.validation.constraints.Max; @@ -19,7 +20,7 @@ public class Dimmable extends Switchable implements RangeTriggerable { @ManyToMany(mappedBy = "dimmables", cascade = CascadeType.DETACH) @GsonExclude @SocketGsonExclude - private Set dimmers; + private Set dimmers = new HashSet<>(); /** The light intensity value. Goes from 0 (off) to 100 (on) */ @NotNull