Device::Yeelight - Controller for Yeelight smart devices

VERSION

Version 0.14

SYNOPSIS

This Perl module implements local device discovery via Yeeling specific SSDP protocol and sending commands via control protocol in the JSON format.

Device::Yeelight module provides base class for detecting Yeelight devices.

use Device::Yeelight;
use feature 'say';

my $yeelight = Device::Yeelight->new();
my @devices = @{$yeelight->search()};
foreach my $device (@devices) {
    my %props = %{$device->get_prop(qw/power/)};
    say "The light is $props{power}";
    $device->set_power('on', 'smooth', 1000);
}
...

SUBROUTINES/METHODS

new

Creates new Yeelight controller.

Sends search request message and waits for devices response.

parse_response

Parse response message from Yeelight device.

AUTHOR

Jan Baier, <jan.baier at amagical.net>

SEE ALSO

Device::Yeelight::Light

BUGS

Please report any bugs or feature requests via https://github.com/baierjan/Device-Yeelight

LICENSE AND COPYRIGHT

Copyright 2019 Jan Baier.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.