def do_force_power_off(): try: res = push_button(**button_params, interval=5) except (SerialException, ): res = (False, ) if False in res: return json.dumps({"result": "Failed"}) else: return json.dumps({"result": "OK"})
def main(): """ main routine. """ kwargs = init_args() ret = push_button(**kwargs)