Esempio n. 1
0
      str(api.get_system_power()))  #Required delay #default 50

print("************* Battery **************")
print("Battery Temp: " + str(api.get_battery_temp()))
print("Battery Voltage: " + str(api.get_battery_voltage()))
print("Battery Current: " + str(api.get_battery_current()))
print("Battery Power: " + str(api.get_battery_power()))
print("Battery Level: " + str(api.get_battery_level()))
print("Battery Health: " + str(api.get_battery_health()))
print("Battery Capacity: " + str(api.get_battery_design_capacity()))

print("************* Fan **************")
print("Fan Health: " + str(api.get_fan_health()))
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
Esempio n. 2
0
#!/usr/bin/env python3

from power_api import SixfabPower, Event, Definition
import time

api = SixfabPower()

print("\r\n")
print("************* Fan **************")
print("Fan Health: " + str(api.get_fan_health()))
print("set Fan Mode: " + str(api.set_fan_mode(3, 10)))
print("get Fan Mode: " + str(api.get_fan_mode()))
print("get Fan Speed: " + str(api.get_fan_speed(10)))
print("set Fan Automation Result: " + str(api.set_fan_automation(20, 60, 10)))
print("get Fan Automation: " + str(api.get_fan_automation(10)))
print("\r\n")
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.: " +