Name

power source filter, powersourcefilter, kPMPowerSourceFilter — A profile for filtering power source changes.

Synopsis

power source filter structure { transport type, name, comparison, options, charging };
transport type : string, choice, optional
name : string, length 1..1024, optional
comparison : string, choice, default, optional
options : array of comparison option elements, optional, unique
charging : boolean, optional

Description

A profile for filtering power source changes.

A computer can have multiple power sources. Power sources can be responsible for a wide range of properties changes and events. The ability to filter these changes is important to allow triggers and conditions to support specific situations involving specific power sources.

Fields

transport type. Trigger only if the power source's type matches.

Use this field to filter power sources by their connection to the host computer. By specifying a transport type of network, only changes to network connected power sources will trigger the trigger.

transport type is a string. transport type is optional. transport type must be one of the following five constants:

  • serial, kPMPowerSourceFilterTransportType_Serial.
  • USB, kPMPowerSourceFilterTransportType_USB.
  • network, kPMPowerSourceFilterTransportType_Network.
  • internal, kPMPowerSourceFilterTransportType_Internal.
  • unknown, kPMPowerSourceFilterTransportType_Unknown.

name. Trigger only if the power source's name matches.

name is a string. name is optional. name must be between 1 and 1024 characters long, inclusive.

comparison. How should the name be compared to the power source name.

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

  • equal to, kPMPowerSourceFilterComparison_EqualTo.
  • not equal to, kPMPowerSourceFilterComparison_NotEqualTo.
  • starts with, kPMPowerSourceFilterComparison_StartsWith.
  • ends with, kPMPowerSourceFilterComparison_EndsWith.
  • contains, kPMPowerSourceFilterComparison_Contains.
  • does not contain, kPMPowerSourceFilterComparison_DoesNotContain.

options. Comparison options allowing fine control over the comparison method.

options is an array of comparison option elements. options is optional. Each item in options must be unique.

charging. Trigger only if the power source's charging matches.

charging is a boolean. charging is optional.