Name

trigger power remaining, triggerpowerremaining, kPMTriggerTriggerPowerRemaining — Trigger when the power remaining changes.

Synopsis

trigger power remaining structure { type, capacity, seconds remaining, filter };
type : string, choice
capacity : integer, default, optional, range 0..100
seconds remaining : integer, default, optional, range 1..86400
filter : power source filter structure, optional

Description

Trigger when the power remaining changes.

The trigger will fire each time a power source's current capacity or seconds remaining changes. The trigger's fields provide a means of filtering the changes to specify specific conditions. These conditions might be to trigger only when a charging battery reaches 95% capacity, or when an internal battery is about to empty.

An empty trigger will cause the trigger to fire every time a power source's current capacity or seconds remaining changes.

Fields

type. Type of trigger being described.

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

capacity. Trigger when a power source reaches or passes this capacity.

A power source's capacity may not increase and decrease in single units. The current capacity value may jump a few percentage points at a time. The trigger will fire when the current capacity equals or passes this capacity value.

If the power source is being charged, the trigger will fire if the capacity equals or is greater than this capacity.

If the power source is being used, the trigger will fire if the capacity equals or is less than this capacity.

The trigger will only fire when the power source reaches or passes this capacity value.

capacity is an integer. If capacity is omitted, the default 50 is used. capacity is optional. capacity must be between 0 and 100, inclusive.

seconds remaining. Trigger when a power source reaches or passes this duration remaining.

seconds remaining is an integer. If seconds remaining is omitted, the default 1800 is used. seconds remaining is optional. seconds remaining must be between 1 and 86400, inclusive.

filter. Power sources to monitor.

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