App-RPi-EnvUI
view release on metacpan or search on metacpan
lib/App/RPi/EnvUI/API.pm view on Meta::CPAN
swap DB objects (and thereby DB handles) within separate processes.
Parameters:
$db_object
Optional, L<App::RPi::EnvUI::DB> object instance.
Returns: The currently loaded DB object instance.
=head2 debug_sensor($bool)
Enable/disable L<RPi::DHT11> sensor's debug print output.
Parameters:
$bool
Optional, Bool. C<1> to enable debugging, C<0> to disable.
Return: Bool. The current state of the sensor's debug state.
Default: False (C<0>)
=head2 env($temp, $humidity)
Sets/gets the current temperature and humidity pair.
Parameters:
All parameters are optional, but if one is sent in, both must be sent in.
$temp
Optional, Integer. The current temperature.
$humidity
Optional, Integer. The current humidity .
Return: A hash reference in the format C<{temp => Int, humidity => Int}>
=head2 env_humidity_aux
Returns the string name of the humidity auxillary channel (default: C<aux2>).
Takes no parameters.
=head2 env_temp_aux
Returns the string name of the temperature auxillary channel (default: C<aux1>).
Takes no parameters.
=head2 env_light_aux
Returns the string name of the light auxillary channel (default: C<aux3>).
Takes no parameters.
=head2 events
Initializes and starts the asynchronous timed events that operate in their own
processes, performing actions outside of the main thread.
Takes no parameters, has no return.
=head2 graph_data
Returns a hash reference with keys C<temp> and C<humidity>, where the values of
each are an array reference of array references with the inner arefs containing
the element number and the temp/humidity value.
It attempts to fetch data for 24 hours, sampling approximately every minute. If
no data is found far enough back, the temp/humidity will be set to C<0>.
=head2 humidity
Returns as an integer, the current humidity level.
=head2 temp
Returns as an integer, the current temperature level.
=head2 set_light_time
Sets in the database the values for lights-on and lights-off time.
Takes no parameters, there is no return.
=head2 log
Returns a pre-configured L<Logging::Simple> object, ready to be cloned with its
C<child()> method.
=head2 log_file($filename)
Sets/gets the log file for the internal logger.
Parameters:
$filename
Optional, String. The name of the log file to use. Note that this won't have any
effect when used in user space, and is mainly a convenience method. It's used
when instantiating a new object.
Return: The string name of the currently in-use log file, if set.
=head2 debug_level($level)
Sets/gets the current debug logging level.
Parameters:
$level
Optional, Integer. Sets the logging level between C<0-7>.
Return: Integer, the current level.
Default: C<-1> (logging disabled)
=head2 passwd($pw)
( run in 1.470 second using v1.01-cache-2.11-cpan-ceb78f64989 )