Battery

"Battery" commands interact with the Battery widget. Available commands are:

  • battery getmode
    Returns the current battery mode of the selected virtual device.
  • battery setmode
    Sets the battery mode of the selected virtual device. The mode can be:
    • host: the virtual battery values reflect the host battery values (if any);
    • manual: the virtual battery charge level and state of charge can be manually set.
  • battery getlevel
    Returns the current battery charge level of the selected virtual device. If the battery mode is "host", the returned value is the host value.
  • battery setlevel
    Sets the battery charge level of the selected virtual device. The value must range from 0% to 100%. This command forces the activation of the manual mode.
  • battery getstatus
    Returns the current battery state of charge of the selected virtual device.
  • battery setstatus
    Sets the battery state of charge of the selected virtual device. Values can be:
    • discharging: simulates that the power supply is unplugged and the battery is discharging.
      The value ranges from 0% to 100%.
    • charging: simulates that the power supply is plugged in and the battery is charging.
      The value ranges from 0% to 100%.
    • notcharging: simulates that the power supply has just been unplugged and the battery is not discharging yet.
      The value ranges from 0% to 100%.
    • full: simulates that the battery is fully charged.