def turn_on_cooling(self): Zone.turn_on_cooling(self) if self.ac_cooling == True: hour = datetime.datetime.now() if hour.hour >= 22 or hour.hour < 8: # 10pm to 8am self.cooling_fan_speed('low') elif hour.hour >= 10 and hour.hour < 18: # 10am to 6pm self.cooling_fan_speed('high') else: # 8am to 10am and 6pm to 10pm self.cooling_fan_speed('auto')