package eu.hsrw.ias.ggd;

import java.util.ArrayList;
import java.util.List;

public class Greenhouse {

  private String id = "8bdbe6ae-eafb-4e99-bb01-db8784dd9633";
  private Severity state = Severity.Unknown;

  public Greenhouse() {
    this.devices = new ArrayList<>();
  }

  public Greenhouse(List<Device> devices) {
    this.devices = devices;
  }

  public void addDevice(Device device) {
    this.devices.add(device);
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public Severity getState() {
    return state;
  }

  public void setState(Severity state) {
    if (this.state != Severity.Critical) {
      this.state = state;
    }
  }

  public List<Device> getDevices() {
    return devices;
  }

  public void setDevices(List<Device> devices) {
    this.devices = devices;
  }

  private List<Device> devices;
}
