package org.iotivity.bridge.homeserver.model;

import org.iotivity.OCEndpoint;

public class Light {

    // Device : oic.d.light
    static public final String DT_LIGHT = "oic.d.light";
    // Resources : oic.r.switch.binary, oic.r.light.dimming
    static public final String RT_BINARYSWITCH = "oic.r.switch.binary";    // required
    static public final String RT_DIMMING = "oic.r.light.dimming";    // optional
    // Properties of BinarySwitch Resource(oic.r.switch.binary)
    static public final String SWITCH_KEY = "value";    // required
    // Properties of Dimming Resource(oic.r.light.dimming)
    static public final String DIMMING_SETTING_KEY = "dimmingSetting"; // required
    static public final String DIMMING_STEP_KEY = "step" ;  // optional, default 5
    static public final String DIMMING_RANGE_KEY = "range" ; // optional, default [0, 100]
    // Properties of light resource name
    static public final String RESOURCE_NAME_KEY = "n" ;  // optional

    public static final String URI_LIGHT = "/light" ;
    public static final String URI_DIMMING = "/dimming" ;

    private String device_name;

    private String resource_name_light = "Light Switch";  // Dimming resource Name
    private String resource_name_dimming = "Dimming Control";  // Dimming resource Name

    private boolean switch_value = false;   // default switch value : false
    private int dimming_level = 30 ;        // default dimming level : 30
    private int dimming_range = 100;        // dimming range : 0 ~ 99
    private int dimming_step = 10;          // dimming step : 10

    //private OCEndpoint serverEndpoint;
    //private String serverUri;

    public Light() {

        this.device_name = "Light";
    }

    public Light(String device_name) {
        this.device_name = device_name;
    }
    public String getDeviceName() {
        return device_name;
    }
    public void setDeviceName(String name) {
        device_name = name ;
    }

    public String getLightResourceName() { return resource_name_light; }
    public void setLightResourceName(String resource_name) {
        this.resource_name_light = resource_name ;
    }

    public String getDimmingResourceName() { return resource_name_dimming; }
    public void setDimmingResourceName(String resource_name) {
        this.resource_name_dimming = resource_name ;
    }

    public boolean isSwitchOn() {
        return switch_value;
    }
    public void setSwitchOn(boolean on) {
        this.switch_value = on;
    }

    public int getDimmingLevel() {
        return dimming_level;
    }
    public void setDimmingLevel(int dimming) {
        this.dimming_level = dimming;
    }

    public int getDimmingStep() {
        return dimming_step;
    }
    public void setDimmingStep(int step) {
        this.dimming_step = step;
    }

    public int getDimmingRange() {
        return dimming_range;
    }
    public void setDimmingRange(int range) {
        this.dimming_range = range;
    }

}
