print("Fan Speed: " + str(api.get_fan_speed())) print("Fan Speeds set: " + str(api.set_fan_automation(40, 65))) print("Fan Mode set: " + str(api.set_fan_mode(3))) print("************* Mode *************") print("Send update: " + str(api.send_system_temp())) print("Work Mode: " + str(api.get_working_mode())) if api.get_working_mode( ) == Definition.BATTERY_POWERED and api.get_input_power() <= 1.: for i in range(4): print("BATTERY MODE") api.set_safe_shutdown_battery_level(15) api.set_safe_shutdown_status(2) # create power off event event = Event() event.id = 1 event.schedule_type = Definition.EVENT_INTERVAL event.repeat = Definition.EVENT_ONE_SHOT event.time_interval = 1 event.interval_type = Definition.INTERVAL_TYPE_SEC event.action = Definition.HARD_POWER_OFF print("Create event: " + str(api.create_scheduled_event_with_event(event, 1))) print("Power off: " + str(api.hard_power_off())) '''
print("************* Others **************") #print("Setting Watchdog Status: " + str(api.set_watchdog_status(1))) #print("Getting Watchdog Status: " + str(api.get_watchdog_status())) print("set RGB Animation.: " + str( api.set_rgb_animation(Definition.RGB_DISABLED, Definition.BLUE, Definition.RGB_SLOW, 10))) print("get RGB Animation Status.: " + str(api.get_rgb_animation(10))) print("set Result Bat. Max Char. Level: " + str(api.set_battery_max_charge_level(80, 10))) print("get Bat. Max Char. Level: " + str(api.get_battery_max_charge_level(10))) print("set Result Safe Shutdown Bat Lev.: " + str(api.set_safe_shutdown_battery_level(40, 10))) print("get Safe Shutdown Bat Lev.: " + str(api.get_safe_shutdown_battery_level(10))) print("set Result Safe Shutdown Bat Status.: " + str(api.set_safe_shutdown_status(1, 10))) print("get Safe Shutdown Bat Status.: " + str(api.get_safe_shutdown_status(10))) #print("set WatchDog Interval.: " + str(api.set_watchdog_interval(10,10))) #print("get WatchDog Interval.: " + str(api.get_watchdog_interval(10))) #print("Button 1 Status: " + str(api.getButton1Status())) #print("Button 2 Status: " + str(api.getButton2Status())) # RTC print("\r\n") print("************* RTC **************") #print("RTC: " + str(api.setRtcTime(1254852))) #print("RTC: " + str(api.getRtcTime(Definition.TIME_FORMAT_DATE_AND_TIME))) epoch = time.time() # to get timestamp in seconds in GMT0 # to get local time on raspberry pi localtime = time.asctime(time.localtime(time.time()))