You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

all_test.py 3.4KB

  1. from pms_api import SixfabPMS, Definition
  2. import time
  3. pms = SixfabPMS()
  4. print("\r\n")
  5. print("************* Input Sensors **************")
  6. print("Input Temp: " + str(pms.getInputTemp()))
  7. print("Input Voltage: " + str(pms.getInputVoltage()))
  8. print("Input Current: " + str(pms.getInputCurrent()))
  9. print("Input Power: " + str(pms.getInputPower())) #Required delay #default 50
  10. print("\r\n")
  11. print("************* System Sensors **************")
  12. print("System Temp: " + str(pms.getSystemTemp()))
  13. print("System Voltage: " + str(pms.getSystemVoltage()))
  14. print("System Current: " + str(pms.getSystemCurrent())) #Required delay #default 50
  15. print("System Power: " + str(pms.getSystemPower())) #Required delay #default 50
  16. print("\r\n")
  17. print("************* Battery **************")
  18. print("Battery Temp: " + str(pms.getBatteryTemp()))
  19. print("Battery Voltage: " + str(pms.getBatteryVoltage()))
  20. print("Battery Current: " + str(pms.getBatteryCurrent()))
  21. print("Battery Power: " + str(pms.getBatteryPower()))
  22. print("Battery Level: " + str(pms.getBatteryLevel()))
  23. print("Battery Health: " + str(pms.getBatteryHealth()))
  24. print("\r\n")
  25. print("************* Fan **************")
  26. print("Fan Health: " + str(pms.getFanHealth()))
  27. print("Fan Speed Result: " + str(pms.setFanSpeed(1)))
  28. print("Fan Speed: " + str(pms.getFanSpeed()))
  29. print("Set Fan Automation Result: " + str(pms.setFanAutomation(20,60)))
  30. print("Fan Automation: " + str(pms.getFanAutomation()))
  31. print("\r\n")
  32. print("************* Others **************")
  33. print("Setting Watchdog Status: " + str(pms.setWatchdogStatus(0)))
  34. print("Getting Watchdog Status: " + str(pms.getWatchdogStatus()))
  35. print("RGB Animation Result: " + str(pms.setRgbAnimation(3,3,3)))
  36. print("RGB Animation: " + str(pms.getRgbAnimation()))
  37. print("Result Bat. Max Char. Level: " + str(pms.setBatteryMaxChargeLevel(90)))
  38. print("Bat. Max Char. Level: " + str(pms.getBatteryMaxChargeLevel()))
  39. print("Result Safe Shutdown Bat Lev.: " + str(pms.setSafeShutdownBatteryLevel(10)))
  40. print("Safe Shutdown Bat Lev.: " + str(pms.getSafeShutdownBatteryLevel()))
  41. print("Result Safe Shutdown Bat Status.: " + str(pms.setSafeShutdownBatteryStatus(0)))
  42. print("Safe Shutdown Bat Status.: " + str(pms.getSafeShutdownBatteryStatus()))
  43. print("Button 1 Status: " + str(pms.getButton1Status()))
  44. print("Button 2 Status: " + str(pms.getButton2Status()))
  45. # RTC
  46. #print("RTC: " + str(pms.setRtcTime(1254852)))
  47. #print("RTC: " + str(pms.getRtcTime(Definition.TIME_FORMAT_DATE_AND_TIME)))
  48. print("Ask Watchdog Alarm: " + str(pms.askWatchdogAlarm()))
  49. # Battery Design Cap
  50. print("Set Battery Design Capacity Result: " + str(pms.setBatteryDesignCapacity(3400)))
  51. print("Battery Design Capacity: " + str(pms.getBatteryDesignCapacity()))
  52. ## Create Scheduled Events
  53. #print("Result creating Scheduled Event: " + str(pms.createScheduledEvent(0,1,2,120,1,(Definition.THURSDAY | Definition.FRIDAY),0)))
  54. #print("Result creating Scheduled Event: " + str(pms.createScheduledEvent(1,1,2,120,1,1,0)))
  55. # Remove event by using id
  56. #print("Result removing Scheduled Event: " + str(pms.removeScheduledEvent(1)))
  57. # Remove all events
  58. #print("Result removing all Scheduled Event: " + str(pms.removeAllScheduledEvents()))
  59. # Firmware Ver.
  60. print("Firmware Ver: " + str(pms.getFirmwareVer()))
  61. # Actions
  62. print("Hard Power Off: " + str(pms.hardPowerOff()))
  63. print("Soft Power Off: " + str(pms.softPowerOff()))
  64. print("Hard Reboot: " + str(pms.hardReboot()))
  65. print("Soft Reboot: " + str(pms.softReboot()))