AHA

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

   license => 'gpl',   
   requires => {
                "LWP::UserAgent" => 0,
                "Encode" => 0,
                "Digest::MD5" => 0
               },
   build_requires => {
                      "Module::Build" => "0.34",
                      "Test::More" => "0",
                     },                       
   configure_requires => { 'Module::Build' => 0.34 },
   keywords => [  "AVM", "AHA", "Fritz", "Dect!200" ]
  );

$build->create_build_script;

META.json  view on Meta::CPAN

      "version" : "2"
   },
   "name" : "AHA",
   "prereqs" : {
      "build" : {
         "requires" : {
            "Module::Build" : "0.34",
            "Test::More" : "0"
         }
      },
      "configure" : {
         "requires" : {
            "Module::Build" : "0.34"
         }
      },
      "runtime" : {
         "requires" : {
            "Digest::MD5" : "0",
            "Encode" : "0",
            "LWP::UserAgent" : "0"
         }

META.yml  view on Meta::CPAN

---
abstract: "Access modules for AVM's home automation system"
author:
  - 'Roland Huss (roland@cpan.org)'
build_requires:
  Module::Build: 0.34
  Test::More: 0
configure_requires:
  Module::Build: 0.34
dynamic_config: 1
generated_by: 'Module::Build version 0.3901, CPAN::Meta::Converter version 2.120630'
license: open_source
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: 1.4
name: AHA
provides:
  AHA:

README.md  view on Meta::CPAN

       say "Name:    ",$switch->name();
       say "State:   ",$switch->is_on();
       say "Present: ",$switch->is_present()
       say "Energy:  ",$switch->energy();
       say "Power:   ",$switch->power();

       # If switch is on, switch if off and vice versa
       $switch->is_on() ? $switch->off() : $switch->on();
    }

    # Access switch directly via name as configured 
    $aha->energy("Lava lamp");

    # ... or by AIN
    $aha->energy("087610077197");
````

### Disclaimer

This module is in no way associated with AVM and is a private
project. Use it on you own risk, see also below.

lib/AHA.pm  view on Meta::CPAN

       say "Name:    ",$switch->name();
       say "State:   ",$switch->is_on();
       say "Present: ",$switch->is_present();
       say "Energy:  ",$switch->energy();
       say "Power:   ",$switch->power();

       # If switch is on, switch if off and vice versa
       $switch->is_on() ? $switch->off() : $switch->on();
    }

    # Access switch directly via name as configured 
    $aha->energy("Lava lamp");

    # ... or by AIN
    $aha->energy("087610077197");

    # Logout 
    $aha->logout();

=head1 DESCRIPTION 

lib/AHA.pm  view on Meta::CPAN

=item * 

Get the current power consumption and consumed energy of an actor (if
it is a plug like the Dect!200)

=back

=head1 METHODS

Many methods of this class take an 8-digit AIN (actor id) or a symbolic name as
argument. This symbolic name can be configured in the admin UI of the Fritz
Box. 

If the argument (name or AIN) is not known, an error is raised (die). The same
is true, if authorization fails.

=over 

=cut

package AHA;

lib/AHA.pm  view on Meta::CPAN

=item port

Port to connect to. It's 80 by default

=item password

Password for connecting to the Fritz Box

=item user

User role for login. Only required if a role based login is configured for the
Fritz box

=back

If used without an hashref as argument, the first argument must be the host, 
the second the password and the third optionally the user.

=cut 

sub new {

lib/AHA/Switch.pm  view on Meta::CPAN

=cut

package AHA::Switch;
use vars qw{$AUTOLOAD};

=item $switch = new AHA::Switch($aha,$ain)

Create a new switch object. The first object must be an L<"AHA"> instance,
which is responsible for the HTTP communication. The second argument Many must
be an 8-digit AIN (actor id) or a symbolic name. This symbolic name
can be configured in the admin UI of the Fritz Box.

=cut

sub new {
    my $class = shift;
    my $aha = shift;
    my $self = {
                aha => $aha,
                ain => $aha->_ain(shift)
               };



( run in 0.411 second using v1.01-cache-2.11-cpan-3989ada0592 )