package com.zoblak.farm;

/**
 * Created by senadu on 11/15/16.
 */

public class AlarmPingResponse {

    private String controller;

    public AlarmPingResponse(String controller) {
        this.controller = controller;
    }

    private Boolean alarmTriggered = false;
    private Boolean tooHot = false;
    private Boolean tooCold = false;
    private Boolean boxSilent = false;
    private Boolean phoneSilent = false;
    private Boolean serverError = false;

    public Boolean getAlarmTriggered() {
        return alarmTriggered;
    }

    public void setAlarmTriggered(Boolean alarmTriggered) {
        this.alarmTriggered = alarmTriggered;
    }

    public Boolean getTooHot() {
        return tooHot;
    }

    public void setTooHot(Boolean tooHot) {
        this.tooHot = tooHot;
    }

    public Boolean getTooCold() {
        return tooCold;
    }

    public void setTooCold(Boolean tooCold) {
        this.tooCold = tooCold;
    }

    public Boolean getBoxSilent() {
        return boxSilent;
    }

    public void setBoxSilent(Boolean boxSilent) {
        this.boxSilent = boxSilent;
    }

    public Boolean getPhoneSilent() {
        return phoneSilent;
    }

    public void setPhoneSilent(Boolean phoneSilent) {
        this.phoneSilent = phoneSilent;
    }

    public Boolean getServerError() {
        return serverError;
    }

    public void setServerError(Boolean serverError) {
        this.serverError = serverError;
    }

    public String toNotificationMessage() {
        String message = "Sve je OK!";
        if(getAlarmTriggered()) {
            if (getAlarmTriggered()) {
                message = "Alarm pokrenut! ";
            }

            if (getTooHot()) {
                message += "Temperatura previsoka!";
            }

            if (getTooCold()) {
                message += "Temperatura preniska!";
            }

            if (getBoxSilent()) {
                message += "Zoblak kutija se nije javila na vrijeme!";
            }

            if (getPhoneSilent()) {
                message += "Ni jedan telefon se nije javio na vrijeme! ";
            }

            if (getServerError()) {
                message += "Ne radi internet na telefonu! ";
            }

        }
        return message;
    }
}