Device::Yeelight::Light - WiFi Smart LED Light
This module provides base class for Yeelight smart device
Creates new Yeelight light device.
Checks if method is supported by the device.
Create and return socket connected to the device.
Sends command to device.
This method is used to retrieve current property of smart LED.
This method is used to change the color temperature of a smart LED.
Target color temperature. The type is integer and range is 1700 ~ 6500 (k).
Support two values: sudden and smooth. If effect is sudden, then the color temperature will be changed directly to target value, under this case, the third parameter duration is ignored. If effect is smooth, then the color temperature will be changed to target value in a gradual fashion, under this case, the total time of gradual change is specified in third parameter duration.
Specifies the total time of the gradual changing. The unit is milliseconds. The minimum support duration is 30 milliseconds.
This method is used to change the color of a smart LED.
Target color, whose type is integer. It should be expressed in decimal integer ranges from 0 to 16777215 (hex: 0xFFFFFF).
Refer to set_ct_abx method.
set_ct_abx
Target hue value, whose type is integer. It should be expressed in decimal integer ranges from 0 to 359.
Target saturation value whose type is integer. It's range is 0 to 100.
This method is used to change the brightness of a smart LED.
Target brightness. The type is integer and ranges from 1 to 100. The brightness is a percentage instead of a absolute value. 100 means maximum brightness while 1 means the minimum brightness.
This method is used to switch on or off the smart LED (software managed on/off).
Can only be on or off. on means turn on the smart LED, off means turn off the smart LED.
This method is used to toggle the smart LED.
This method is used to save current state of smart LED in persistent memory. So if user powers off and then powers on the smart LED again (hard power reset), the smart LED will show last saved state.
This method is used to start a color flow. Color flow is a series of smart LED visible state changing. It can be brightness changing, color changing or color temperature changing. This is the most powerful command.
Total number of visible state changing before color flow stopped. 0 means infinite loop on the state changing.
The action taken after the flow is stopped.
The expression of the state changing series.
Gradual change time or sleep time, in milliseconds, minimum value 50.
Brightness value, -1 or 1 ~ 100. Ignored when mode is 7. When this value is -1, brightness in this tuple is ignored (only color or CT change takes effec
This method is used to stop a running color flow.
This method is used to set the smart LED directly to specified state. If the smart LED is off, then it will turn on the smart LED firstly and then apply the specified command.
This method is used to start a timer job on the smart LED.
Currently can only be 0 (means power off).
Length of the timer (in minutes).
This method is used to retrieve the setting of the current cron job of the specified type.
The type of the cron job (currently only support 0).
This method is used to stop the specified cron job.
This method is used to change brightness, CT or color of a smart LED without knowing the current value, it's main used by controllers.
The direction of the adjustment, the valid value can be:
The property to adjust. The valid value can be:
(When prop is color, the action can only be circle, otherwise, it will be deemed as invalid request.)
prop
action
This method is used to start or stop music mode on a device. Under music mode, no property will be reported and no message quota is checked.
The action of set_music command. The valid value can be:
set_music
The IP address of the music server.
The TCP port music application is listening on.
This method is used to name the device. The name will be stored on the device and reported in discovering response. User can also read the name through get_prop method.
get_prop
The name of the device.
This method is used to adjust the brightness by specified percentage within specified duration.
The percentage to be adjusted. The range is: -100 ~ 100
Refer to "set_ct_abx" method.
This method is used to adjust the color temperature by specified percentage within specified duration.
This method is used to adjust the color within specified duration.
These methods are used to control background light, for each command detail, refer to set_xxx command.
Refer to set_xxx command.
set_xxx
This method is used to adjust background light by specified percentage within specified duration.
Refer to adjust_bright, adjust_ct, adjust_color.
adjust_bright
adjust_ct
adjust_color
This method is used to toggle the main light and background light at the same time.
Jan Baier, <jan.baier at amagical.net>
<jan.baier at amagical.net>
This API is described in the Yeeling WiFi Light Inter-Operation Specification.
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.
To install Device::Yeelight, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::Yeelight
CPAN shell
perl -MCPAN -e shell install Device::Yeelight
For more information on module installation, please visit the detailed CPAN module installation guide.