2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 04:36:36 +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:
betateilchen 2015-02-03 14:56:17 +00:00
parent 571614df98
commit 72bd715c33

View File

@ -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;
}
##################
#