Exemplo n.º 1
0
#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()))
#print("Local current time :", localtime)
# to get timezone difference as minus
Exemplo n.º 2
0
from power_api import SixfabPower, Definition, Event
import time

api = SixfabPower()

print("Battery Max Level: " + str(api.get_battery_max_charge_level()))
print("Battery Safe Level: " + str(api.get_safe_shutdown_battery_level()))
print("Battery Safe Status: " + str(api.get_safe_shutdown_status()))
print("Battery Design Cap: " + str(api.get_battery_design_capacity()))

#print( "Return: " + str(api.set_lpm_status(2)))
print("LPM: " + str(api.get_lpm_status()))

#print( "Return: " + str(api.set_watchdog_status(2)))
print("WDT Status: " + str(api.get_watchdog_status()))

#print( "Return: " + str(api.set_watchdog_interval(2)))
print("WDT Interval: " + str(api.get_watchdog_interval()))

#print( "Return: " + str(api.set_fan_mode(2)))
print("Fan Mode: " + str(api.get_fan_mode()))

#print( "Return: " + str(api.set_battery_separation_status(1)))
print("Battery Separation: " + str(api.get_battery_separation_status()))

#print( "Return: " + str(api.set_rgb_animation(2,7,3)))
print("RGB Anim: " + str(api.get_rgb_animation()))

#print( "Return: " + str(api.set_fan_automation(50)))

#print( "Return: " + str(api.set_power_outage_event_status(1)))