NAME

Power::Outlet::Config - Control and query a Power::Outlet device from Configuration file

SYNOPSIS

my $outlet = Power::Outlet::Config->new(section=>"My Section");
print $outlet->query, "\n";
print $outlet->on, "\n";
print $outlet->off, "\n";

DESCRIPTION

Power::Outlet::Config is a package for controlling and querying Power::Outlet devices registered in an INI file.

USAGE

Configuration

/etc/power-outliet.ini
[My Tasmota]
type=Tasmota
host=light-hostname
relay=POWER

[My SonoffDiy]
type=SonoffDiy
host=switch=hostname

Script

use Power::Outlet::Config;
my $outlet = Power::Outlet::Config->new(section=>"My Section");
print $outlet->on, "\n";

Command Line

/usr/bin/power-outlet Config ON section "My Tasmota"
/usr/bin/power-outlet Config ON section "My Section" ini_file ./my.ini

CONSTRUCTOR

new

my $outlet = Power::Outlet->new(type=>"Config", section=>"My Section");
my $outlet = Power::Outlet::Config->new(section=>"My Section");

PROPERTIES

section

hash

OBJECT ACCESSORS

ini

Returns a Config::IniFiles for the power-outlet.ini file.

ini_file

Default: /etc/power-outlet.ini or C:\Windows\power-outlet.ini

ini_file_default

Default: power-outlet.ini

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

Copyright (c) 2020 Michael R. Davis

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