コード例 #1
0
ファイル: driver.py プロジェクト: rezarajan/tgcpifiles
    def cool(self) -> Dict[str, float]:
        if self.peltier_pin != None and pi_gpio_available and not self.simulate:
            """ Cooling """
            try:
                GPIO.output(self.peltier_pin, GPIO.LOW)
                time.sleep(0.1)

                self.logger.debug("Cooling")
                return 1
            except Exception as e:
                raise exceptions.TurnOffError(logger=self.logger) from e
            return 0 # Failed
        else:
            if self.simulate:
                self.logger.debug("Cooling")
                return 1 # Simulating a successful command
            else:
                return 0 #Failed
コード例 #2
0
ファイル: driver.py プロジェクト: rezarajan/tgcpifiles
    def turn_off(self) -> Dict[str, float]:
        if self.peltier_pin != None and pi_gpio_available and not self.simulate:
            """ Turn Off"""
            try:
                GPIO.output(self.peltier_pin, GPIO.LOW)
                time.sleep(0.1)


                self.logger.debug("Turning off the Peltier")
                return 0
            except Exception as e:
                raise exceptions.TurnOffError(logger=self.logger) from e
            return 1 # Failed to reset
        else:
            if self.simulate:
                self.logger.debug("Turning off the Peltier")
                return 0 # Simulating a successful reset
            else:
                return 1 #Failed to reset
コード例 #3
0
ファイル: driver.py プロジェクト: rezarajan/tgcpifiles
    def turn_off_roots(self) -> Dict[str, float]:
        if self.fan_pin_roots != None and self.humidifier_pin != None and pi_gpio_available and not self.simulate:
            """ Turn Off"""
            try:
                GPIO.output(self.fan_pin_roots, GPIO.LOW)
                time.sleep(0.1)
                GPIO.output(self.humidifier_pin, GPIO.LOW)

                self.logger.debug("Turning off the SpaceVAC root zone fans")
                return 1
            except Exception as e:
                raise exceptions.TurnOffError(logger=self.logger) from e
            return 0  # Failed to reset
        else:
            if self.simulate:
                self.logger.debug("Turning off the SpaceVAC root zone fans")
                return 1  # Simulating a successful reset
            else:
                return 0  #Failed to reset
コード例 #4
0
ファイル: driver.py プロジェクト: rezarajan/tgcpifiles
    def cool_roots(self) -> Dict[str, float]:
        if self.fan_pin_roots != None and self.humidifier_pin != None and pi_gpio_available and not self.simulate:
            """ Cooling """
            try:
                GPIO.output(self.fan_pin_roots, GPIO.HIGH)
                time.sleep(0.1)
                GPIO.output(self.humidifier_pin, GPIO.HIGH)

                self.logger.debug("Turning ON Root Zone Fan")
                return 1
            except Exception as e:
                raise exceptions.TurnOffError(logger=self.logger) from e
            return 0  # Failed to reset
        else:
            if self.simulate:
                self.logger.debug("Turning ON Root Zone Fan")
                return 1  # Simulating a successful latch set
            else:
                return 0  #Failed to set latch