2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-26 10:34:52 +00:00

FULLY: Adjust brightness

git-svn-id: https://svn.fhem.de/fhem/trunk@15428 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
zap 2017-11-13 12:46:53 +00:00
parent bbcbfbe4cf
commit 263e14f63d
2 changed files with 18 additions and 4 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: 89_FULLY: New commands for motion detection and brightness
- update: 98_Siro.pm: add Disable attribute
- bugfix: 50_TelegramBot: fix minusdesc warning / cleanup
- fix: 71_YAMAHA_AVR: fix navigateListMenu on RX-Vx65/RX-Vx67 series

View File

@ -1,6 +1,6 @@
##############################################################################
#
# 89_FULLY.pm 0.4
# 89_FULLY.pm 0.5
#
# $Id$
#
@ -32,7 +32,7 @@ sub FULLY_GotDeviceInfo ($);
sub FULLY_Abort ($);
sub FULLY_UpdateReadings ($$);
my $FULLY_VERSION = "0.4";
my $FULLY_VERSION = "0.5";
my $FULLY_TIMEOUT = 4;
my $FULLY_POLL_INTERVAL = 3600;
@ -173,8 +173,8 @@ sub FULLY_Set ($@)
my ($hash, $a, $h) = @_;
my $name = shift @$a;
my $opt = shift @$a;
my $options = "clearCache:noArg exit:noArg lock:noArg motionDetection:on,off off:noArg ".
"on:noArg restart:noArg unlock:noArg speak url";
my $options = "brightness clearCache:noArg exit:noArg lock:noArg motionDetection:on,off ".
"off:noArg on:noArg restart:noArg unlock:noArg speak url";
my $response;
# Fully commands without argument
@ -188,6 +188,13 @@ sub FULLY_Set ($@)
if (exists ($cmds{$opt})) {
$response = FULLY_Execute ($hash, $cmds{$opt}, undef);
}
elsif ($opt eq 'brightness') {
my $value = shift @$a;
return "Usage: set $name brightness 0-255" if (!defined ($value));
$value = 255 if ($value > 255);
$response = FULLY_Execute ($hash, "setStringSetting",
{ "key" => "screenBrightness", "value" => "$value" });
}
elsif ($opt eq 'motionDetection') {
my $state = shift @$a;
return "Usage: set $name motionDetection {on|off}" if (!defined ($state));
@ -348,6 +355,9 @@ sub FULLY_ProcessDeviceInfo ($$)
next;
}
}
elsif ($rn eq 'screen_brightness') {
$rn = "brightness";
}
elsif ($rn eq 'screen_status') {
$parameters .= "|state=$rv";
}
@ -482,6 +492,9 @@ sub FULLY_UpdateReadings ($$)
<a name="FULLYset"></a>
<b>Set</b><br/><br/>
<ul>
<li><b>set &lt;name&gt; brightness 0-255</b><br/>
Adjust screen brightness.
</li><br/>
<li><b>set &lt;name&gt; clearCache</b><br/>
Clear browser cache.
</li><br/>