from espmega_mqtt import ESPMegaMQTT
from time import sleep

class ac:
    def __init__(self):
        self.plc = ESPMegaMQTT()
        pass

    def light_on(self):
        self.plc.write_pwm(0,1,4095)
    def light_off(self):
        self.plc.write_pwm(0,0,4095)
    def get_door_state(self) -> bool:
        return self.plc.read_digital(0)
    def get_scan_state(self) -> bool:
        return self.plc.read_digital(1)
    def lock_door(self):
        self.plc.write_pwm(1,1,4095)
    def unlock_door(self):
        self.plc.write_pwm(1,0,4095)