Group
Extension

Matches 5

Device-TPLink ( V/VE/VERLIN/Device-TPLink-0.02.tar.gz, VERLIN, 2018; MetaCPAN )
Device-TPLink/lib/Device/TPLink.pm ( view source; MetaCPAN )
ntation on the TP-Link smart plug devices, including a more-or-less complete documentation of the JSON API.

=item * GadgetReactor's "pyHS100" project on GitHub

L<https://github.com/GadgetReactor/pyH
Device-TPLink ( V/VE/VERLIN/Device-TPLink-0.02.tar.gz, VERLIN, 2018; MetaCPAN )
Device-TPLink/lib/Device/TPLink/SmartHome/Direct.pm ( view source; MetaCPAN )
w();
    ...

=head1 SUBROUTINES/METHODS

=head2 passthrough

Recieves an object, formats it as a JSON command and passes it to the device. Returns a response object.

=cut

sub passthrough {
  my $se


  my $json = JSON->new->allow_nonref;
  # Fun fact: For the HS105, your JSON cannot have any newlines in it, so no pretty JSON for us...
  # $json = $json->pretty(1);
  my $plaintext = $json->encode
 $responseLength = 0; }
  }
  $responseData = decrypt($responseData);
  my $responseDataScalar = $json->decode($responseData);
  return $responseDataScalar;
}

=head2 function2

=cut

# Pass the comma
Device-TPLink ( V/VE/VERLIN/Device-TPLink-0.02.tar.gz, VERLIN, 2018; MetaCPAN )
Device-TPLink/lib/Device/TPLink/Kasa.pm ( view source; MetaCPAN )
ce::TPLink::Kasa;

use 5.008003;
use Moose;
use Carp;
use JSON; # The Kasa API is JSON based
use LWP::JSON::Tiny; # Simplify working with JSON requests
use UUID::Generator::PurePerl; # Used to generat
 = {
     method => 'login',
     params => $credentials
  };

  my $user_agent = LWP::UserAgent::JSON->new;
  # Uncomment the next two lines if you need to debug...
  #$user_agent->add_handler("reque
 = HTTP::Request::JSON->new(POST => "https://wap.tplinkcloud.com");
  $request->header('Accept' => '*/*'); # Really, really annoying, but required by Kasa service...
  $request->json_content( $request
Device-TPLink ( V/VE/VERLIN/Device-TPLink-0.02.tar.gz, VERLIN, 2018; MetaCPAN )
Device-TPLink/lib/Device/TPLink/SmartHome/Kasa.pm ( view source; MetaCPAN )
package Device::TPLink::SmartHome::Kasa;

use 5.008003;
use Moose;
use LWP::JSON::Tiny;

extends 'Device::TPLink::SmartHome';

has token => (
  is => 'rw',
  isa => 'Str',
);

=head1 NAME

Device::TPL
INES/METHODS

=head2 passthrough

Passes an arbitrary object to the device after converting it to JSON and wrapping it in a Kasa request. Used internally to package commands and send them to the devic
 = @_;

  my $json = JSON->new->allow_nonref;
  $json = $json->pretty(1);

  my $user_agent = LWP::UserAgent::JSON->new;
  my $params = { deviceId => $self->deviceId, requestData => $json->encode($req
Device-TPLink ( V/VE/VERLIN/Device-TPLink-0.02.tar.gz, VERLIN, 2018; MetaCPAN )
Device-TPLink/lib/Device/TPLink/SmartHome.pm ( view source; MetaCPAN )
package Device::TPLink::SmartHome;

use 5.008003;
use Moose;
use Carp;
use JSON;

=head1 NAME

Device::TPLink::SmartHome - Base class for TPLink Smart Home devices

=head1 VERSION

Version 0.02

=cut
 {
  my $requestData = { system => { reboot => { delay => 1 }}};
  return $requestData;
}

sub TO_JSON { return { %{ shift() } }; }



=head1 AUTHOR

Verlin Henderson, C<< <verlin at gmail.com> >>

=h

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.