mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
contrib/Infopanel: added btIP_changeColor()
git-svn-id: https://svn.fhem.de/fhem/trunk@7845 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
571614df98
commit
72bd715c33
@ -81,7 +81,7 @@ sub InfoPanel_Initialize($) {
|
||||
$hash->{DefFn} = "btIP_Define";
|
||||
$hash->{UndefFn} = "btIP_Undef";
|
||||
#$hash->{AttrFn} = "btIP_Attr";
|
||||
$hash->{AttrList} = "disable:0,1,toggle autoreload:1,0 bg bgcolor refresh size title tmin";
|
||||
$hash->{AttrList} = "disable:0,1 autoreload:1,0 bg bgcolor refresh size title tmin";
|
||||
$hash->{SetFn} = "btIP_Set";
|
||||
$hash->{NotifyFn} = "btIP_Notify";
|
||||
|
||||
@ -541,6 +541,17 @@ sub btIP_xy {
|
||||
return($x,$y);
|
||||
}
|
||||
|
||||
sub btIP_changeColor {
|
||||
my($file,$oldcolor,$newcolor) = @_;
|
||||
my ($data,$readBytes);
|
||||
my $length = -s "$file";
|
||||
open(GRAFIK, "<", $file) or die("File not found $!");
|
||||
binmode(GRAFIK);
|
||||
$readBytes = read(GRAFIK, $data, $length);
|
||||
close(GRAFIK);
|
||||
$data =~ s/#$oldcolor/#$newcolor/g;
|
||||
return $data;
|
||||
}
|
||||
|
||||
##################
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user