コード例 #1
0
ファイル: pms_read_sensors.py プロジェクト: ad5030/OIAP
print("System Current: " + str(api.get_system_current()))               #Required delay #default 50
print("System Power: " + 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 Max Charge Level: " + str(api.get_battery_max_charge_level()))
print("Battery Capacity: " + str(api.get_battery_design_capacity()))

print("************* Safe Shutdown **************")
print("Battery Safe Shutdown Battery Level: " + str(api.get_safe_shutdown_battery_level()))
print("Battery Safe Shutdown Battery Status: " + str(api.get_safe_shutdown_battery_status()))

print("************* Fan **************")
print("Fan Health: " + str(api.get_fan_health()))
print("Fan Speed: " + str(api.get_fan_speed()))
print("Fan Fan Automation: " + str(api.get_fan_automation()))

print("************* rtc time **************")
print("RTC Time: " + str(api.get_rtc_time(Definition.TIME_FORMAT_EPOCH)))
print("RTC Time: " + str(api.get_rtc_time(Definition.TIME_FORMAT_DATE_AND_TIME)))

print("************* Firmware Ver **************")
print("Firmware Ver: " + str(api.get_firmware_ver()))

print("************* Event **************")
print("IDs of Scheduled Events: " + str(api.get_scheduled_event_ids()))
コード例 #2
0
ファイル: pms_init.py プロジェクト: ad5030/OIAP
#!/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.: " +