package com.example.iot_controlhost.model.controller.relay;

import com.example.iot_controlhost.utils.global.RoomController;

/**
 * @Description 有在装配式控制器-中盛0-10V模拟量型号的情况下使用
 * 应用场景：设置继电器时（端口）；操作地暖时（地址）;检测继电器功耗异常时（开关）；
 * @Author DuanKaiji
 * @CreateTime 2023年12月05日 11:19:12
 */
public class FloorRelay extends Relay {

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

    @Override
    public boolean setPowerSupply(boolean state) {
        this.powerSupply = state;
        return RoomController.floor.isPowerSupply() == state;
    }

    @Override
    public boolean isEnable() {
        return RoomController.floor.isEnable();
    }

    @Override
    public boolean isAvailable() {
        return RoomController.floor.isAvailable();
    }

}
