ErnGusMik / python-tello

Chained comparison detected PYL-R1716
Anti-pattern
Minor
2 occurrences in this check
Simplify chained comparison between the operands
444    def set_speed(self, x: int):
445        """Sends command to set speed to x cm/s"""
446        logging.debug("Sending command: set_speed()")
447        if x >= 1 and x <= 100:448            return self.run(f"speed {str(x)}",
449                            f"Setting speed to {str(x)} cm/s \r\n")
450        logging.warning("tello.set_speed(): Invalid value.")
Simplify chained comparison between the operands
475    def set_mission_direction(self, x: int):
476        """Sends command to set mission pad detection direction"""
477        logging.debug("Sending command: set_mission_direction()")
478        if x >= 0 and x <= 3:479            return self.run(
480                f"mdirection {str(x)}",
481                f"Setting Mission Pad Detection to setting {str(x)}\r\n",