2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 10:46:53 +00:00

37_NotifyAndroidTV.pm: added fontsize parameter

fixed default.* attributes


git-svn-id: https://svn.fhem.de/fhem/trunk@21245 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2020-02-22 10:02:36 +00:00
parent 0b3fbe6a7f
commit a7482a455a
2 changed files with 21 additions and 15 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: 37_NotifyAndroidTV.pm added fontsize parameter
- change: 73_DoorBird: Added wiki link
- feature: 39_alexa.pm: support for proactive event reporting
- change: 98_weekprofile: change file functions to support configdb

View File

@ -50,6 +50,11 @@ my $options = { position => { 'bottom-right' => 0,
'noimage' => 4,
'short' => 5,
},
fontsize => { 'default' => 2,
'small' => 1,
'medium' => 2,
'large' => 3,
},
duration => undef,
offset => undef,
offsety => undef,
@ -150,9 +155,17 @@ NotifyAndroidTV_Set($$@)
my $list = 'msg';
if( $cmd && ($cmd eq 'msg' || $cmd eq 'notify') ) {
my ($param_a, $param_h) = parseParams(\@params);
if( $cmd && ($cmd eq 'msg' || $cmd eq 'notify') ) {
foreach my $option (keys %{$options}) {
if( !defined($param_h->{$option}) ) {
if( my $default = AttrVal($name, "default". ucfirst $option, undef) ) {
$param_h->{$option} = $default;
}
}
}
my $txt = join( ' ', @{$param_a} );
$txt =~ s/\n/<br>/g;
@ -176,14 +189,6 @@ NotifyAndroidTV_Set($$@)
return "error: $error" if( $error );
foreach my $option (keys %{$options}) {
if( !defined($param_h->{$option}) ) {
if( my $default = AttrVal($name, "default". ucfirst $option, undef) ) {
$param_h->{$option} = $default;
}
}
}
$param_h->{offset} = 0 if( !$param_h->{offset} );
$param_h->{offsety} = 0 if( !$param_h->{offsety} );
$param_h->{transparency} = 0 if( !$param_h->{transparency} );
@ -357,7 +362,7 @@ NotifyAndroidTV_Attr($$$)
<b>Set</b>
<ul>
<li>msg [options] &lt;message&gt;<br>
possible options are: bkgcolor, interrupt, position, transparency, duration, offset, offsety, width, type, icon, image, title, imageurl. use <code>set &lt;name&gt; notify</code> to see valid values.<br>
possible options are: bkgcolor, interrupt, position, transparency, duration, offset, offsety, width, type, fontsize, icon, image, title, imageurl. use <code>set &lt;name&gt; notify</code> to see valid values.<br>
<code>set nb msg ?</code> shows a help text<br>
it is better to use imageurl instad of image as it is non blocking!<br>
image can be given as <code>image={&lt;perlCode&gt;}</code></li>