package com.example.iot_controlhost.model.sensor;

/**
 * 噪音传感器
 */
public class NoiseSensor extends Sensor {

    /**
     * 噪声值
     */
    private double noise;

    public NoiseSensor(String name) {
        super(name);
    }

    /**
     * 解析噪声的方法
     *
     * @return 解析成功与否
     */
    @Override
    public boolean collectSensorData(String model, String address) {
        return false;
    }

    @Override
    public String[] getModels() {
        return new String[]{"?"};
    }


    @Override
    public String toString() {
        return "噪声：" + noise + "dB";
    }

    public double getNoise() {
        return noise;
    }

    public void setNoise(double noise) {
        this.noise = noise;
    }

    @Override
    public boolean setAddressToNewAddress(String model, String oldAddress,String oldBaud, String newAddress) {
        return false;
    }

    @Override
    public boolean setBaudToNewBaud(String model, String oldAddress, String newBaud) {
        return false;
    }
}
