The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Power::Outlet::Common - Power::Outlet base class for all power outlets

SYNOPSIS

  use base qw{Power::Outlet::Common};

DESCRIPTION

Power::Outlet::Common is a base class for controlling and querying a power outlets.

USAGE

  use base qw{Power::Outlet::Common};

CONSTRUCTOR

new

METHODS

query

The query method must be overridden in the sub class.

  $outlet->query;  #returns ON|OFF Note: may return other values for edge case

on

The on method must be overridden in the sub class.

  $outlet->on;   #turns the outlet on reguardless of current state and returns ON.

Note: This should cancel any non-blocking cycle requests

off

The off method must be overridden in the sub class.

  $outlet->off;   #turns the outlet off reguardless of current state and returns OFF.

Note: This should cancel any non-blocking cycle requests

switch

Only override the switch method if your hardware natively supports this capability. However, it should still be documented.

  $outlet->switch; #turns the outlet off if on and on if off and returns the final state ON|OFF.

Note: The default implementations does not cancel non-blocking cycle requests

cycle

Only override the cycle method if your hardware natively supports this capability. However, it should still be documented.

  $outlet->cycle; #turns the outlet off-on-off or on-off-on with a delay and returns the final state ON|OFF.

Note: Implementations may be blocking or non-blocking.

cycle_duration

Override the cycle_duration method if you want.

Default; 10 seconds (floating point number)

name

User friendly name for an outlet.

BUGS

Please log on RT and send an email to the author.

SUPPORT

DavisNetworks.com supports all Perl applications including this package.

AUTHOR

  Michael R. Davis
  CPAN ID: MRDVT
  DavisNetworks.com

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

SEE ALSO