Name

condition power remaining, conditionpowerremaining, kPMConditionConditionPowerRemaining — Conditional on the power remaining.

Synopsis

condition power remaining structure { invert, type, current capacity, seconds remaining, comparison, filter };
invert : boolean, default, optional
type : string, choice
current capacity : integer, optional, range 0..100
seconds remaining : integer, optional
comparison : string, choice, default, optional
filter : power source filter structure, optional

Description

Conditional on the power remaining.

Where both a current capacity and seconds remaining value are provided, both must be true for the condition to be evaluated as true.

Where neither current capacity or seconds remaining are provided, no power sources will be matched, and the condition will always evaulate to false.

Only one power source needs to match this condition in order to return true.

Fields

invert. Invert the condition's conclusion.

Conditions are designed to positively identify specific states. Many events will want a condition to confirm that a specific state is not occuring. To reverse the role of a positive condition, use the invert field.

If a condition is true, and the invert field is set, the condition will invert the true and return false.

If a condition is false, and the invert field is set, the condition will invert the false and return true.

invert is a boolean. If invert is omitted, the default false is used. invert is optional.

type. Type of condition to test.

type is a string. type must be power remaining, kPMConditionType_PowerRemaining.

current capacity. Current percentage capacity.

current capacity is an integer. current capacity is optional. current capacity must be between 0 and 100, inclusive.

seconds remaining. Estimated time remaining until fully charged or empty.

Combine seconds remaining with a filter containing a charging value. A positive charging value indicates the power source's seconds remaining are expected to increase. A negative charging value indicates the power source's seconds remaining are expected to decline.

seconds remaining is an integer. seconds remaining is optional.

comparison. Method to compare the current capacity and seconds remaining with.

comparison is a string. If comparison is omitted, the default equal to is used. comparison is optional. comparison must be one of the following six constants:

  • equal to, kPMConditionComparison_EqualTo.
  • not equal to, kPMConditionComparison_NotEqualTo.
  • greater than, kPMConditionComparison_GreaterThan.
  • less than, kPMConditionComparison_LessThan.
  • greater than or equal to, kPMConditionComparison_GreaterThanOrEqualTo.
  • less than or equal to, kPMConditionComparison_LessThanOrEqualTo.

filter. Power sources to monitor.

filter is a power source filter structure. filter is optional.